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
/* the database on which to act */
85
////////////////////////////////////////////////////////////////////////////////
89
* An exclusive transaction
108
91
class immediate_transaction
110
public detail::basic_transaction
93
public basic_transaction
112
95
//______________________________________________________________________________
117
* Constructor that provides a connection upon which to act
118
* @param connection a connection
100
* Constructor that provides a database upon which to act
101
* @param database a database
120
103
explicit immediate_transaction(
121
connection &connection );
104
database &database );
123
106
//______________________________________________________________________________
124
107
// public interface
141
124
class exclusive_transaction
143
public detail::basic_transaction
126
public basic_transaction
145
128
//______________________________________________________________________________
150
* Constructor that provides a connection upon which to act
151
* @param connection a connection
133
* Constructor that provides a database upon which to act
134
* @param database a database
153
136
explicit exclusive_transaction(
154
connection &connection );
137
database &database );
156
139
//______________________________________________________________________________
157
140
// public interface
174
157
class recursive_transaction
176
public detail::basic_transaction
159
public basic_transaction
178
161
//______________________________________________________________________________
183
* Constructor that provides a connection upon which to act
184
* @param connection a connection
166
* Constructor that provides a database upon which to act
167
* @param database a database
186
169
explicit recursive_transaction(
187
connection &connection );
170
database &database );
189
172
//______________________________________________________________________________
190
173
// public interface
222
* A scope guard (sentinel) for use with one of the transaction classes to
223
* provide RIAA-style transactions.
205
* A scope guard, or sentinel for use with one of the transaction classes.
225
template< class T = deferred_tranaction >
207
template< class T = basic_transaction >
226
208
class transaction_guard
228
210
private boost::noncopyable
235
* Constructor that provides a connection upon which to act
236
* @param connection a connection
217
* Constructor that provides a database upon which to act
218
* @param database a database
238
220
explicit transaction_guard(
239
connection &connection )
241
_transaction( connection ),
223
_transaction( database ),
242
224
_released( false )
244
226
_transaction.begin();