--- postgresql-7.0.3/src/interfaces/libpq++/pgtransdb.cc	Sun May 30 17:17:58 1999
+++ postgresql-7.0.3-jtv/src/interfaces/libpq++/pgtransdb.cc	Wed Feb 28 13:34:20 2001
@@ -25,7 +25,8 @@
 // Make a connection to the specified database with default environment
 // See PQconnectdb() for conninfo usage. 
 PgTransaction::PgTransaction(const char* conninfo)
-   : PgDatabase(conninfo)
+   : PgDatabase(conninfo),
+     pgCommitted(true)
 {
 	BeginTransaction();
 }
@@ -33,17 +34,20 @@
 // Destructor: End the transaction block
 PgTransaction::~PgTransaction()
 {
-	EndTransaction();
+	if (!pgCommitted) Exec("ABORT");
 }
 
 // Begin the transaction block
 ExecStatusType PgTransaction::BeginTransaction()
 {
+        pgCommitted = false;
 	return Exec("BEGIN");
 } // End BeginTransaction()
 
 // Begin the transaction block
 ExecStatusType PgTransaction::EndTransaction()
 {
+        pgCommitted = true;
 	return Exec("END");
 } // End EndTransaction()
+



--- postgresql-7.0.3/src/interfaces/libpq++/pgtransdb.h	Sun Apr 23 00:39:15 2000
+++ postgresql-7.0.3-jtv/src/interfaces/libpq++/pgtransdb.h	Wed Feb 28 13:34:42 2001
@@ -36,9 +36,9 @@
 // the object is destroyed.
 class PgTransaction : public PgDatabase {
 public:
-  PgTransaction(const char* conninfo);	// use reasonable & environment defaults
+  explicit PgTransaction(const char conninfo[]);	// use reasonable & environment defaults
   // connect to the database with given environment and database name
-  // PgTransaction(const PgConnection&);
+  // explicit PgTransaction(const PgConnection&);
   ~PgTransaction();	// close connection and clean up
   
 protected:
@@ -46,9 +46,11 @@
   ExecStatusType EndTransaction();
   
 protected:
-  PgTransaction() : PgDatabase() {}	// Do not connect
+  PgTransaction() : PgDatabase(), pgCommitted(true) {}	// Do not connect
 
 private:
+  bool pgCommitted;
+
 // We don't support copying of PgTransaction objects,
 // so make copy constructor and assignment op private.
    PgTransaction(const PgTransaction&);
