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
/** close any in-progress statements */
80
void invalidate_queries();
82
/** the database on which to act */
88
////////////////////////////////////////////////////////////////////////////////
92
* 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
94
108
class immediate_transaction
96
public basic_transaction
110
public detail::basic_transaction
98
112
//______________________________________________________________________________
103
* Constructor that provides a database upon which to act
104
* @param database a database
117
* Constructor that provides a connection upon which to act
118
* @param connection a connection
106
120
explicit immediate_transaction(
107
database &database );
121
connection &connection );
109
123
//______________________________________________________________________________
110
124
// public interface
127
141
class exclusive_transaction
129
public basic_transaction
143
public detail::basic_transaction
131
145
//______________________________________________________________________________
136
* Constructor that provides a database upon which to act
137
* @param database a database
150
* Constructor that provides a connection upon which to act
151
* @param connection a connection
139
153
explicit exclusive_transaction(
140
database &database );
154
connection &connection );
142
156
//______________________________________________________________________________
143
157
// public interface
160
174
class recursive_transaction
162
public basic_transaction
176
public detail::basic_transaction
164
178
//______________________________________________________________________________
169
* Constructor that provides a database upon which to act
170
* @param database a database
183
* Constructor that provides a connection upon which to act
184
* @param connection a connection
172
186
explicit recursive_transaction(
173
database &database );
187
connection &connection );
175
189
//______________________________________________________________________________
176
190
// public interface
208
* 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.
210
template< class T = basic_transaction >
225
template< class T = deferred_tranaction >
211
226
class transaction_guard
213
228
private boost::noncopyable
220
* Constructor that provides a database upon which to act
221
* @param database a database
235
* Constructor that provides a connection upon which to act
236
* @param connection a connection
223
238
explicit transaction_guard(
239
connection &connection )
226
_transaction( database ),
241
_transaction( connection ),
227
242
_released( false )
229
244
_transaction.begin();