39
* A basic (default, deferred) transaction.
41
class basic_transaction
43
private boost::noncopyable
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 (the default)
99
typedef detail::basic_transaction deferred_tranaction;
102
////////////////////////////////////////////////////////////////////////////////
106
* An immediate transaction
45
//______________________________________________________________________________
50
* Constructor that provides a database upon which to act
51
* @param database a database
53
explicit basic_transaction(
56
//______________________________________________________________________________
61
* Begin the transaction
66
* Commit the transaction
68
virtual void commit();
71
* Rollback the transaction
73
virtual void rollback();
75
//______________________________________________________________________________
79
/** close any in-progress statements */
80
void invalidate_queries();
82
/** the database on which to act */
88
////////////////////////////////////////////////////////////////////////////////
92
* An exclusive transaction
108
94
class immediate_transaction
110
public detail::basic_transaction
96
public basic_transaction
112
98
//______________________________________________________________________________
117
* Constructor that provides a connection upon which to act
118
* @param connection a connection
103
* Constructor that provides a database upon which to act
104
* @param database a database
120
106
explicit immediate_transaction(
121
connection &connection );
107
database &database );
123
109
//______________________________________________________________________________
124
110
// public interface
141
127
class exclusive_transaction
143
public detail::basic_transaction
129
public basic_transaction
145
131
//______________________________________________________________________________
150
* Constructor that provides a connection upon which to act
151
* @param connection a connection
136
* Constructor that provides a database upon which to act
137
* @param database a database
153
139
explicit exclusive_transaction(
154
connection &connection );
140
database &database );
156
142
//______________________________________________________________________________
157
143
// public interface
174
160
class recursive_transaction
176
public detail::basic_transaction
162
public basic_transaction
178
164
//______________________________________________________________________________
183
* Constructor that provides a connection upon which to act
184
* @param connection a connection
169
* Constructor that provides a database upon which to act
170
* @param database a database
186
172
explicit recursive_transaction(
187
connection &connection );
173
database &database );
189
175
//______________________________________________________________________________
190
176
// public interface
222
* A scope guard (sentinel) for use with one of the transaction classes to
223
* provide RIAA-style transactions.
208
* A scope guard, or sentinel for use with one of the transaction classes.
225
template< class T = deferred_tranaction >
210
template< class T = basic_transaction >
226
211
class transaction_guard
228
213
private boost::noncopyable
235
* Constructor that provides a connection upon which to act
236
* @param connection a connection
220
* Constructor that provides a database upon which to act
221
* @param database a database
238
223
explicit transaction_guard(
239
connection &connection )
241
_transaction( connection ),
226
_transaction( database ),
242
227
_released( false )
244
229
_transaction.begin();