// ********************************************************************** // // Copyright (c) 2003-2014 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. // // ********************************************************************** #ifndef FREEZE_TRANSACTIONI_H #define FREEZE_TRANSACTIONI_H #include #include #include namespace Freeze { class ConnectionI; typedef IceUtil::Handle ConnectionIPtr; struct SharedMutex; typedef IceUtil::Handle SharedMutexPtr; class SharedDbEnv; typedef IceUtil::Handle SharedDbEnvPtr; class PostCompletionCallback : public virtual IceUtil::Shared { public: virtual void postCompletion(bool, bool, const SharedDbEnvPtr&) = 0; }; typedef IceUtil::Handle PostCompletionCallbackPtr; class TransactionI : public Transaction { public: virtual void commit(); virtual void rollback(); virtual ConnectionPtr getConnection() const; // // Custom refcounting implementation // virtual void __incRef(); virtual void __decRef(); virtual int __getRef() const; void rollbackInternal(bool); void setPostCompletionCallback(const PostCompletionCallbackPtr&); TransactionI(ConnectionI*); ~TransactionI(); DbTxn* dbTxn() const { return _txn; } private: friend class ConnectionI; int __getRefNoSync() const; void postCompletion(bool, bool); const Ice::CommunicatorPtr _communicator; ConnectionIPtr _connection; const Ice::Int _txTrace; const Ice::Int _warnRollback; DbTxn* _txn; PostCompletionCallbackPtr _postCompletionCallback; SharedMutexPtr _refCountMutex; int _refCount; }; typedef IceUtil::Handle TransactionIPtr; } #endif