1997-02-13 11:01:05 +01:00
|
|
|
/*-------------------------------------------------------------------------
|
|
|
|
*
|
|
|
|
* pgtransdb.h
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* DESCRIPTION
|
|
|
|
* Postgres Transaction Database Class:
|
|
|
|
* Query Postgres backend using a transaction block
|
|
|
|
*
|
|
|
|
* NOTES
|
|
|
|
* Currently under construction.
|
|
|
|
*
|
2000-01-26 06:58:53 +01:00
|
|
|
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc
|
|
|
|
* Portions Copyright (c) 1994, Regents of the University of California
|
1997-02-13 11:01:05 +01:00
|
|
|
*
|
1999-05-23 03:04:07 +02:00
|
|
|
*
|
2000-01-26 06:58:53 +01:00
|
|
|
* $Id: pgtransdb.h,v 1.4 2000/01/26 05:58:48 momjian Exp $
|
1999-05-23 03:04:07 +02:00
|
|
|
*
|
1997-02-13 11:01:05 +01:00
|
|
|
*-------------------------------------------------------------------------
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef PGTRANSDB_H
|
|
|
|
#define PGTRANSDB_H
|
|
|
|
|
|
|
|
#include "pgdatabase.h"
|
|
|
|
|
|
|
|
// ****************************************************************
|
|
|
|
//
|
|
|
|
// PgTransaction - a class for running transactions against databases
|
|
|
|
//
|
|
|
|
// ****************************************************************
|
|
|
|
// This is the database access class that keeps an open
|
|
|
|
// transaction block during its lifetime. The block is ENDed when
|
|
|
|
// the object is destroyed.
|
|
|
|
class PgTransaction : public PgDatabase {
|
|
|
|
public:
|
1999-05-23 03:04:07 +02:00
|
|
|
PgTransaction(const char* conninfo); // use reasonable & environment defaults
|
1997-02-13 11:01:05 +01:00
|
|
|
// connect to the database with given environment and database name
|
1999-06-01 04:37:33 +02:00
|
|
|
// PgTransaction(const PgConnection&);
|
1999-05-23 03:04:07 +02:00
|
|
|
~PgTransaction(); // close connection and clean up
|
1997-02-13 11:01:05 +01:00
|
|
|
|
|
|
|
protected:
|
|
|
|
ExecStatusType BeginTransaction();
|
|
|
|
ExecStatusType EndTransaction();
|
|
|
|
|
|
|
|
protected:
|
|
|
|
PgTransaction() : PgDatabase() {} // Do not connect
|
|
|
|
}; // End PgTransaction Class Declaration
|
|
|
|
|
|
|
|
#endif // PGTRANSDB_H
|