/sqlite3cc

To get this branch, use:
bzr branch http://bzr.ed.am/sqlite3cc

« back to all changes in this revision

Viewing changes to include/sqlite3cc/transaction.h

  • Committer: Tim Marston
  • Date: 2015-02-26 08:59:36 UTC
  • Revision ID: tim@ed.am-20150226085936-xe43in8bfz6f6nxb
fixed some missing/incorrect includes

Show diffs side-by-side

added added

removed removed

Lines of Context:
244
244
                connection &connection )
245
245
                :
246
246
                _transaction( connection ),
247
 
                _released( false )
 
247
                _released( true )
248
248
        {
249
249
                _transaction.begin();
 
250
                _released = false;
250
251
        }
251
252
 
252
253
        ~transaction_guard()
260
261
public:
261
262
 
262
263
        /**
 
264
         * Begin the transaction. Note that this is done automatically in the
 
265
         * constructor.
 
266
         */
 
267
        void begin()
 
268
        {
 
269
                if( _released ) {
 
270
                        _transaction.begin();
 
271
                        _released = false;
 
272
                }
 
273
        }
 
274
 
 
275
        /**
263
276
         * Commit the transaction.
264
277
         */
265
278
        void commit()
271
284
        }
272
285
 
273
286
        /**
274
 
         * Rollback the transaction early.
 
287
         * Rollback the transaction. Note that this is done automatically in the
 
288
         * destructor if the transaction hasn't otherwise been completed.
275
289
         */
276
290
        void rollback()
277
291
        {