ScopedTransaction Class Reference

A scoped database transaction. More...

#include <SQLDatabase.h++>

List of all members.

Public Member Functions

 ScopedTransaction (SQLDatabase &database) throw (SQLException)
 Construct a new ScopedTransaction for the given SQLDatabase.
 ~ScopedTransaction () throw ()
 Destructor.
void commit () throw (SQLException, TimeoutException)
 Commit the transaction.

Detailed Description

A scoped database transaction.

ScopedTransaction begins a transaction in its constructor, and automatically rolls back the transaction when it goes out of scope, if the transaction had not previously been committed via a call to commit().

Author:
Mark Lindner

Constructor & Destructor Documentation

ScopedTransaction ( SQLDatabase database  )  throw (SQLException)

Construct a new ScopedTransaction for the given SQLDatabase.

Parameters:
database The database.
Exceptions:
SQLException If a database error occurs.
~ScopedTransaction (  )  throw ()

Destructor.

Rolls back the transaction if it has not been committed via a call commit().


Member Function Documentation

void commit (  )  throw (SQLException, TimeoutException)

Commit the transaction.

Exceptions:
SQLException If a database error occurs.
TimeoutException If a timeout occurs while waiting for database locks. The call should be retried in this case.

The documentation for this class was generated from the following files:
Generated on Sat Nov 26 16:49:09 2011 for libcommonc++ by  doxygen 1.6.3