1 // **********************************************************************
3 // Copyright (c) 2003-2011 ZeroC, Inc. All rights reserved.
5 // This copy of Ice is licensed to you under the terms described in the
6 // ICE_LICENSE file included in this distribution.
8 // **********************************************************************
10 #ifndef FREEZE_TRANSACTIONI_H
11 #define FREEZE_TRANSACTIONI_H
13 #include <Ice/CommunicatorF.h>
14 #include <Freeze/Transaction.h>
21 typedef IceUtil::Handle
<ConnectionI
> ConnectionIPtr
;
24 typedef IceUtil::Handle
<SharedMutex
> SharedMutexPtr
;
27 typedef IceUtil::Handle
<SharedDbEnv
> SharedDbEnvPtr
;
29 class PostCompletionCallback
: public virtual IceUtil::Shared
33 virtual void postCompletion(bool, bool, const SharedDbEnvPtr
&) = 0;
35 typedef IceUtil::Handle
<PostCompletionCallback
> PostCompletionCallbackPtr
;
37 class TransactionI
: public Transaction
41 virtual void commit();
43 virtual void rollback();
46 virtual ConnectionPtr
getConnection() const;
49 // Custom refcounting implementation
51 virtual void __incRef();
52 virtual void __decRef();
53 virtual int __getRef() const;
55 void rollbackInternal(bool);
56 void setPostCompletionCallback(const PostCompletionCallbackPtr
&);
58 TransactionI(ConnectionI
*);
69 friend class ConnectionI
;
71 int __getRefNoSync() const;
73 void postCompletion(bool, bool);
75 const Ice::CommunicatorPtr _communicator
;
76 ConnectionIPtr _connection
;
77 const Ice::Int _txTrace
;
78 const Ice::Int _warnRollback
;
80 PostCompletionCallbackPtr _postCompletionCallback
;
81 SharedMutexPtr _refCountMutex
;
85 typedef IceUtil::Handle
<TransactionI
> TransactionIPtr
;