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

pqxx::RobustTransaction Class Reference

Slower, better fortified version of Transaction. More...

#include <robusttransaction.h>

Inheritance diagram for pqxx::RobustTransaction:

pqxx::TransactionItf List of all members.

Public Methods

 RobustTransaction (Connection &, PGSTD::string Name=PGSTD::string())
virtual ~RobustTransaction ()

Detailed Description

Slower, better fortified version of Transaction.

RobustTransaction is similar to Transaction, but spends more effort (and performance!) to deal with the hopefully rare case that the connection to the backend is lost just as the current transaction is being committed. In this case, there is no way to determine whether the backend managed to commit the transaction before noticing the loss of connection.

In such cases, transaction class tries to reconnect to the database and figure out what happened. It will need to store and manage some information (pretty much a user-level transaction log) in the back-end for each and every transaction just on the off chance that this problem might occur. This service level was made optional since you may not want to pay this overhead where it is not necessary. Certainly the use of this class makes no sense for local connections, or for transactions that read the database but never modify it, or for noncritical database manipulations.

Besides being slower, you may find that RobustTransaction actually fails more instead of less often than a normal Transaction. This is due to the added work and complexity. What RobustTransaction tries to achieve is to be more deterministic, not more successful per se.


Constructor & Destructor Documentation

pqxx::RobustTransaction::RobustTransaction Connection  ,
PGSTD::string    Name = PGSTD::string()
[explicit]
 

pqxx::RobustTransaction::~RobustTransaction   [virtual]
 


The documentation for this class was generated from the following files:
Generated on Sat Aug 10 21:52:39 2002 for libpqxx by doxygen1.2.16