1 /*-------------------------------------------------------------------------
7 * Postgres Transaction Database Class:
8 * Query Postgres backend using a transaction block
11 * Currently under construction.
13 * Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
14 * Portions Copyright (c) 1994, Regents of the University of California
17 * $Id: pgtransdb.h,v 1.7 2001/05/09 17:29:10 momjian Exp $
19 *-------------------------------------------------------------------------
26 #include "pgdatabase.h"
29 // ****************************************************************
31 // PgTransaction - a class for running transactions against databases
33 // ****************************************************************
34 // This is the database access class that keeps an open
35 // transaction block during its lifetime. The block is ENDed when
36 // the object is destroyed.
37 class PgTransaction : public PgDatabase {
39 explicit PgTransaction(const char* conninfo); // use reasonable & environment defaults
40 // connect to the database with given environment and database name
41 // explicit PgTransaction(const PgConnection&);
42 ~PgTransaction(); // close connection and clean up
45 ExecStatusType BeginTransaction();
46 ExecStatusType EndTransaction();
49 PgTransaction() : PgDatabase(), pgCommitted(true) {} // Do not connect
54 // We don't support copying of PgTransaction objects,
55 // so make copy constructor and assignment op private.
56 PgTransaction(const PgTransaction&);
57 PgTransaction& operator= (const PgTransaction&);
58 }; // End PgTransaction Class Declaration