libcommonc++  0.7
SQLTransaction Class Reference

A scoped database transaction. More...

#include <SQLDatabase.h++>

Public Member Functions

 SQLTransaction (SQLDatabase &database)
 Construct a new SQLTransaction for the given SQLDatabase. More...
 
 ~SQLTransaction ()
 Destructor. More...
 
void commit ()
 Commit the transaction. More...
 

Detailed Description

A scoped database transaction.

SQLTransaction 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

◆ SQLTransaction()

SQLTransaction ( SQLDatabase database)

Construct a new SQLTransaction for the given SQLDatabase.

Parameters
databaseThe database.
Exceptions
SQLExceptionIf a database error occurs.

◆ ~SQLTransaction()

Destructor.

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

Member Function Documentation

◆ commit()

void commit ( )

Commit the transaction.

Exceptions
SQLExceptionIf a database error occurs.
TimeoutExceptionIf 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: