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