pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Bruce Momjian <pgman@candle.pha.pa.us>
To: Piotr Klaban <post@klaban.torun.pl>
Cc: PostgreSQL-patches <pgsql-patches@postgresql.org>
Cc: PostgreSQL-interfaces <pgsql-interfaces@postgresql.org>
Subject: Re: [BUGS] Bug #708:  PgTransaction class is broken since 7.2
Date: Fri, 12 Jul 2002 21:47:13 -0400 (EDT)
Message-ID: <200207130147.g6D1lDQ00896@candle.pha.pa.us> (raw)
In-Reply-To: <20020712100351.GR29639@oryl.man.torun.pl>

Piotr Klaban wrote:
> > > PgTransaction class is broken since 7.2
> 
> On Thu, Jul 11, 2002 at 12:41:24PM -0400, Bruce Momjian wrote:
> > 
> > OK, would you send us a correcting patch?  Thanks.
> 
> Thank you for a quick reply.
> Sure. If you do not mind, I will enclosed it with this letter
> directly to you.

This person would like the following patch applied to libpq++ to fix a
problem with pg2xbase.  I have attached the bug report and his proposed
patch of removing 'protected' from two methods:
	
	-protected:
	   ExecStatusType BeginTransaction();
	   ExecStatusType EndTransaction();

It this acceptable to people?

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026

Attachments:

/bjm/9 (text/plain, 1.3K) download sql-bugs@postgresql.org wrote: Piotr Klaban (makler@man.torun.pl) reports a bug with a severity of 2 The lower the number the more severe it is. Short Description PgTransaction class is broken since 7.2 Long Description Hi, You have introduced the patch http://www.geocrawler.com/archives/3/105/2001/2/0/5248369/ that broke my pg2xbase C++ utility, because I can not COMMIT the transaction. Before the patch it works exactly as it is described in the pgtransdb.h file: // This is the database access class that keeps an open // transaction block during its lifetime. The block is ENDed when // the object is destroyed. But it is not true now. There is a private variable called pgCommitted that is set to false in protected method BeginTransaction() When I delete PgTransaction object - transaction is ABORTed. I can not use EndTransaction() protected method in my C++ file (gcc 3.0.3 complains). Maybe both methods should be public. Now I use PgDatabase object with two query calls BEGIN ... END it is safer. -- Bruce Momjian | http://candle.pha.pa.us pgman@candle.pha.pa.us | (610) 853-3000 + If your life is a hard drive, | 830 Blythe Avenue + Christ can be your backup. | Drexel Hill, Pennsylvania 19026
/bjm/diff2 (text/plain, 956B) download --- postgresql-7.2.1/src/interfaces/libpq++/pgtransdb.h.old Thu Jul 12 00:12:43 2001 +++ postgresql-7.2.1/src/interfaces/libpq++/pgtransdb.h Fri Jul 12 11:53:50 2002 @@ -32,8 +32,9 @@ // // **************************************************************** // This is the database access class that keeps an open -// transaction block during its lifetime. The block is ENDed when -// the object is destroyed. +// transaction block during its lifetime. The block is ABORTed when +// the object is destroyed, unless you call EndTransaction() method +// before destruction of the object. class DLLIMPORT PgTransaction : public PgDatabase { public: explicit PgTransaction(const char* conninfo); // use reasonable & environment defaults @@ -41,7 +42,6 @@ // explicit PgTransaction(const PgConnection&); ~PgTransaction(); // close connection and clean up -protected: ExecStatusType BeginTransaction(); ExecStatusType EndTransaction();

Message-ID: <200207130147.g6D1lDQ00896@candle.pha.pa.us>
Permalink:  ../200207130147.g6D1lDQ00896@candle.pha.pa.us/
Also on:    postgresql.org/message-id/200207130147.g6D1lDQ00896@candle.pha.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-interfaces@postgresql.org
  Cc: pgman@candle.pha.pa.us, post@klaban.torun.pl, pgsql-patches@postgresql.org
  Subject: Re: [BUGS] Bug #708:  PgTransaction class is broken since 7.2
  In-Reply-To: <200207130147.g6D1lDQ00896@candle.pha.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox