/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: edam
  • Date: 2012-01-23 14:34:45 UTC
  • Revision ID: edam@waxworlds.org-20120123143445-s2v4v90nycmfm6bv
fixed up tests

Show diffs side-by-side

added added

removed removed

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