Savarese Software Research Corporation
DatabaseTransaction Class Reference

Use DatabaseTransaction to ensure a transaction is rolled back if an exception is thrown. More...

#include <DatabaseTransaction.h>

Inheritance diagram for DatabaseTransaction:

List of all members.

Public Member Functions

 DatabaseTransaction (DatabaseWrapper &dbw) SSRC_DECL_THROW(DatabaseException)
 DatabaseTransaction (Database &db) SSRC_DECL_THROW(DatabaseException)
void end () SSRC_DECL_THROW(DatabaseException)
void rollback () SSRC_DECL_THROW(DatabaseException)
 ~DatabaseTransaction ()

Detailed Description

Use DatabaseTransaction to ensure a transaction is rolled back if an exception is thrown.

DatabaseTransaction begins a database transaction in its constructor. If DatabaseTransaction::end() is called before the instance is destroyed, the transaction is committed. Otherwise, the destructor rolls back the transaction.

Definition at line 70 of file DatabaseTransaction.h.


Constructor & Destructor Documentation

Definition at line 77 of file DatabaseTransaction.h.

DatabaseTransaction::DatabaseTransaction ( Database &  db) [inline]

Definition at line 85 of file DatabaseTransaction.h.

Definition at line 106 of file DatabaseTransaction.h.

References rollback().


Member Function Documentation

void DatabaseTransaction::rollback ( ) [inline]

Definition at line 99 of file DatabaseTransaction.h.

Referenced by ~DatabaseTransaction().


The documentation for this class was generated from the following file:

Savarese Software Research Corporation
Copyright © 2006-2011 Savarese Software Research Corporation. All rights reserved.