38
class basic_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
108
class immediate_transaction
40
private boost::noncopyable
110
public detail::basic_transaction
42
112
//______________________________________________________________________________
47
* Constructor that provides a database upon which to act
48
* @param database a database
117
* Constructor that provides a connection upon which to act
118
* @param connection a connection
50
explicit basic_transaction(
120
explicit immediate_transaction(
121
connection &connection );
53
123
//______________________________________________________________________________
54
124
// public interface
60
130
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 */
82
135
////////////////////////////////////////////////////////////////////////////////
139
* An exclusive transaction
85
141
class exclusive_transaction
87
public basic_transaction
143
public detail::basic_transaction
89
145
//______________________________________________________________________________
94
* Constructor that provides a database upon which to act
95
* @param database a database
150
* Constructor that provides a connection upon which to act
151
* @param connection a connection
97
153
explicit exclusive_transaction(
154
connection &connection );
100
156
//______________________________________________________________________________
101
157
// public interface
112
168
////////////////////////////////////////////////////////////////////////////////
172
* A recursive transaction, allowing transactions to be nested.
115
174
class recursive_transaction
117
public basic_transaction
176
public detail::basic_transaction
119
178
//______________________________________________________________________________
124
* Constructor that provides a database upon which to act
125
* @param database a database
183
* Constructor that provides a connection upon which to act
184
* @param connection a connection
127
186
explicit recursive_transaction(
128
database &database );
187
connection &connection );
130
189
//______________________________________________________________________________
131
190
// public interface
159
218
////////////////////////////////////////////////////////////////////////////////
162
template< class T = basic_transaction >
222
* A scope guard (sentinel) for use with one of the transaction classes to
223
* provide RIAA-style transactions.
225
template< class T = deferred_tranaction >
163
226
class transaction_guard
165
228
private boost::noncopyable
172
* Constructor that provides a database upon which to act
173
* @param database a database
235
* Constructor that provides a connection upon which to act
236
* @param connection a connection
175
238
explicit transaction_guard(
239
connection &connection )
178
_transaction( database ),
241
_transaction( connection ),
179
242
_released( false )
181
244
_transaction.begin();