42
* A basic (default, deferred) transaction.
44
class basic_transaction
46
private boost::noncopyable
48
//__________________________________________________________________________
53
* Constructor that provides a connection upon which to act
54
* @param connection a connection
56
explicit basic_transaction(
57
connection &connection );
59
//__________________________________________________________________________
64
* Begin the transaction
69
* Commit the transaction
71
virtual void commit();
74
* Rollback the transaction
76
virtual void rollback();
78
//__________________________________________________________________________
82
/** reset any in-progress statements */
83
void reset_active_queries();
85
/** the connection on which to act */
86
connection &_connection;
93
////////////////////////////////////////////////////////////////////////////////
97
* A deferred transaction
99
typedef detail::basic_transaction deferred_transaction;
102
////////////////////////////////////////////////////////////////////////////////
106
* An immediate transaction
108
class immediate_transaction
38
class basic_transaction
110
public detail::basic_transaction
40
private boost::noncopyable
112
42
//______________________________________________________________________________
117
* Constructor that provides a connection upon which to act
118
* @param connection a connection
47
* Constructor that provides a database upon which to act
48
* @param database a database
120
explicit immediate_transaction(
121
connection &connection );
50
explicit basic_transaction(
123
53
//______________________________________________________________________________
124
54
// public interface
130
60
virtual void begin();
63
* Commit the transaction
65
virtual void commit();
68
* Rollback the transaction
70
virtual void rollback();
72
//______________________________________________________________________________
76
/* the database on which to act */
135
82
////////////////////////////////////////////////////////////////////////////////
139
* An exclusive transaction
141
85
class exclusive_transaction
143
public detail::basic_transaction
87
public basic_transaction
145
89
//______________________________________________________________________________
150
* Constructor that provides a connection upon which to act
151
* @param connection a connection
94
* Constructor that provides a database upon which to act
95
* @param database a database
153
97
explicit exclusive_transaction(
154
connection &connection );
156
100
//______________________________________________________________________________
157
101
// public interface
168
112
////////////////////////////////////////////////////////////////////////////////
172
* A recursive transaction, allowing transactions to be nested.
174
115
class recursive_transaction
176
public detail::basic_transaction
117
public basic_transaction
178
119
//______________________________________________________________________________
183
* Constructor that provides a connection upon which to act
184
* @param connection a connection
124
* Constructor that provides a database upon which to act
125
* @param database a database
186
127
explicit recursive_transaction(
187
connection &connection );
128
database &database );
189
130
//______________________________________________________________________________
190
131
// public interface
218
159
////////////////////////////////////////////////////////////////////////////////
222
* A scope guard (sentinel) for use with one of the transaction
223
* classes to provide RAII-style transactions. It defaults to using
224
* deferred transactions.
226
template< class T = deferred_transaction >
162
template< class T = basic_transaction >
227
163
class transaction_guard
229
165
private boost::noncopyable
236
* Constructor that provides a connection upon which to act
237
* @param connection a connection
172
* Constructor that provides a database upon which to act
173
* @param database a database
239
175
explicit transaction_guard(
240
connection &connection )
242
_transaction( connection ),
178
_transaction( database ),
243
179
_released( false )
245
181
_transaction.begin();