Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

pqxx::transaction< ISOLATIONLEVEL > Class Template Reference

Standard back-end transaction, templatized on isolation level. More...

#include <transaction.h>

Inheritance diagram for pqxx::transaction< ISOLATIONLEVEL >:

pqxx::basic_transaction pqxx::dbtransaction pqxx::transaction_base List of all members.

Public Types

typedef isolation_traits<
ISOLATIONLEVEL > 
isolation_tag
 If nothing else is known, our isolation level is at least read_committed.


Public Member Functions

 transaction (connection_base &C, const PGSTD::string &TName=PGSTD::string())
virtual ~transaction ()

Detailed Description

template<isolation_level ISOLATIONLEVEL = read_committed>
class pqxx::transaction< ISOLATIONLEVEL >

Standard back-end transaction, templatized on isolation level.

Use a transaction object to enclose operations on a database in a single "unit of work." This ensures that the whole series of operations either succeeds as a whole or fails completely. In no case will it leave half finished work behind in the database.

Queries can currently only be issued through a transaction.

Once processing on a transaction has succeeded and any changes should be allowed to become permanent in the database, call Commit(). If something has gone wrong and the changes should be forgotten, call Abort() instead. If you do neither, an implicit Abort() is executed at destruction time.

It is an error to abort a transaction that has already been committed, or to commit a transaction that has already been aborted. Aborting an already aborted transaction or committing an already committed one has been allowed to make errors easier to deal with. Repeated aborts or commits have no effect after the first one.

Database transactions are not suitable for guarding long-running processes. If your transaction code becomes too long or too complex, please consider ways to break it up into smaller ones. There's no easy, general way to do this since application-specific considerations become important at this point.


Member Typedef Documentation

template<isolation_level ISOLATIONLEVEL = read_committed>
typedef isolation_traits<ISOLATIONLEVEL> pqxx::transaction< ISOLATIONLEVEL >::isolation_tag
 

If nothing else is known, our isolation level is at least read_committed.

Reimplemented from pqxx::transaction_base.


Constructor & Destructor Documentation

template<isolation_level ISOLATIONLEVEL = read_committed>
pqxx::transaction< ISOLATIONLEVEL >::transaction connection_base   C,
const PGSTD::string &    TName = PGSTD::string()
[explicit]
 

Create a transaction. The optional name, if given, must begin with a letter and may contain letters and digits only.

template<isolation_level ISOLATIONLEVEL = read_committed>
virtual pqxx::transaction< ISOLATIONLEVEL >::~transaction   [virtual]
 


The documentation for this class was generated from the following file:
Generated on Sat Jun 7 00:49:36 2003 for libpqxx by doxygen1.3-rc3