Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

pqxx::nontransaction Class Reference

Simple "transaction" class offering no transactional integrity. More...

#include <nontransaction.hxx>

Inheritance diagram for pqxx::nontransaction:

pqxx::transaction_base pqxx::internal::namedclass List of all members.

Public Member Functions

 nontransaction (connection_base &C, const PGSTD::string &NName=PGSTD::string())
 Constructor.
virtual ~nontransaction ()

Detailed Description

Simple "transaction" class offering no transactional integrity.

nontransaction, like transaction or any other transaction_base-derived class, provides access to a database through a connection. Unlike its siblings, however, nontransaction does not maintain any kind of transactional integrity. This may be useful eg. for read-only access to the database that does not require a consistent, atomic view on its data; or for operations that are not allowed within a backend transaction, such as creating tables. For queries that update the database, however, a real transaction is likely to be faster unless the transaction consists of only a single record update. As a side effect, you can keep a nontransaction open for as long as you like. Actual back-end transactions are limited in lifespan, and will sometimes fail just because they took too long to execute. This will not happen with a nontransaction. It may need to restore its connection, but it won't abort as a result.

Any query executed in a nontransaction is committed immediately, and neither Commit() nor Abort() has any effect.

Database features that require a backend transaction, such as cursors or large objects, will not work in a nontransaction.


Constructor & Destructor Documentation

pqxx::nontransaction::nontransaction connection_base C,
const PGSTD::string &  NName = PGSTD::string()
[explicit]
 

Constructor.

Create a "dummy" transaction.

Parameters:
C Connection that this "transaction" will operate on.
NName Optional name for the transaction, beginning with a letter and containing only letters and digits.

pqxx::nontransaction::~nontransaction  )  [virtual]
 


The documentation for this class was generated from the following files:
Generated on Mon Nov 15 11:28:03 2004 for libpqxx by  doxygen 1.3.9.1