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

transaction.hxx

Go to the documentation of this file.
00001 /*-------------------------------------------------------------------------
00002  *
00003  *   FILE
00004  *      pqxx/transaction.hxx
00005  *
00006  *   DESCRIPTION
00007  *      definition of the pqxx::transaction class.
00008  *   pqxx::transaction represents a standard database transaction
00009  *   DO NOT INCLUDE THIS FILE DIRECTLY; include pqxx/transaction instead.
00010  *
00011  * Copyright (c) 2001-2004, Jeroen T. Vermeulen <jtv@xs4all.nl>
00012  *
00013  * See COPYING for copyright license.  If you did not receive a file called
00014  * COPYING with this source code, please notify the distributor of this mistake,
00015  * or contact the author.
00016  *
00017  *-------------------------------------------------------------------------
00018  */
00019 #include "pqxx/dbtransaction"
00020 
00021 
00022 
00023 /* Methods tested in eg. self-test program test1 are marked with "//[t1]"
00024  */
00025 
00026 
00027 namespace pqxx
00028 {
00029 
00030 class PQXX_LIBEXPORT basic_transaction : public dbtransaction
00031 {
00032 protected:
00033   explicit basic_transaction(connection_base &C, 
00034                              const PGSTD::string &IsolationLevel,
00035                              const PGSTD::string &TName);               //[t1]
00036 
00037 private:
00038   virtual void do_begin();                                              //[t1]
00039   virtual void do_commit();                                             //[t1]
00040   virtual void do_abort();                                              //[t13]
00041 };
00042 
00043 
00045 
00073 template<isolation_level ISOLATIONLEVEL=read_committed>
00074 class transaction : public basic_transaction
00075 {
00076 public:
00077   typedef isolation_traits<ISOLATIONLEVEL> isolation_tag;
00078 
00080 
00085   explicit transaction(connection_base &C, const PGSTD::string &TName): //[t1]
00086     basic_transaction(C, isolation_tag::name(), TName) 
00087         { Begin(); }
00088 
00089   explicit transaction(connection_base &C) :                            //[t1]
00090     basic_transaction(C, isolation_tag::name(), PGSTD::string()) 
00091         { Begin(); }
00092 
00093   virtual ~transaction() throw () { End(); }
00094 
00095 protected:
00096   virtual const char *classname() const throw () { return "transaction"; }
00097 };
00098 
00099 
00101 typedef transaction<> work;
00102 
00103 }
00104 
00105 

Generated on Mon Nov 15 11:28:01 2004 for libpqxx by  doxygen 1.3.9.1