# subtransaction.hxx

    00001 /*-------------------------------------------------------------------------
    00002  *
    00003  *   FILE
    00004  *      pqxx/subtransaction.hxx
    00005  *
    00006  *   DESCRIPTION
    00007  *      definition of the pqxx::subtransaction class.
    00008  *   pqxx::subtransaction is a nested transaction, i.e. one within a transaction
    00009  *   DO NOT INCLUDE THIS FILE DIRECTLY; include pqxx/subtransaction instead.
    00010  *
    00011  * Copyright (c) 2005-2008, 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 #ifndef PQXX_H_SUBTRANSACTION
    00020 #define PQXX_H_SUBTRANSACTION
    00021
    00022 #include "pqxx/compiler-public.hxx"
    00023 #include "pqxx/compiler-internal-pre.hxx"
    00024
    00025 #include "pqxx/dbtransaction"
    00026
    00027
    00028
    00029 /* Methods tested in eg. self-test program test1 are marked with "//[t1]"
    00030  */
    00031
    00032
    00033 namespace pqxx
    00034 {
    00035
    00039
    00040
    00081 class PQXX_LIBEXPORT subtransaction :
    00082   public internal::transactionfocus,
    00083   public dbtransaction
    00084 {
    00085 public:
    00086   explicit subtransaction(dbtransaction &T,
    00087         const PGSTD::string &Name=PGSTD::string());                     //[t88]
    00088
    00089 private:
    00090   virtual void do_begin();                                              //[t88]
    00091   virtual void do_commit();                                             //[t88]
    00092   virtual void do_abort();                                              //[t88]
    00093
    00094   void check_backendsupport() const;
    00095
    00096   dbtransaction &m_parent;
    00097 };
    00098
    00099 }
    00100
    00101
    00102 #include "pqxx/compiler-internal-post.hxx"
    00103
    00104 #endif
    00105