Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 2A74D475C45 for ; Mon, 18 Nov 2002 05:15:53 -0500 (EST) Received: from mail04.svc.cra.dublin.eircom.net (mail04.svc.cra.dublin.eircom.net [159.134.118.20]) by postgresql.org (Postfix) with SMTP id C158B475AD7 for ; Mon, 18 Nov 2002 05:15:51 -0500 (EST) Received: (qmail 65862 messnum 1206273 invoked from network[159.134.166.17/p529.as1.limerick1.eircom.net]); 18 Nov 2002 10:15:52 -0000 Received: from p529.as1.limerick1.eircom.net (HELO dansat.data-plan.com) (159.134.166.17) by mail04.svc.cra.dublin.eircom.net (qp 65862) with SMTP; 18 Nov 2002 10:15:52 -0000 Received: from dansat.data-plan.com (localhost [127.0.0.1]) by dansat.data-plan.com (8.12.6/8.12.6) with ESMTP id gAIAFtqg017423; Mon, 18 Nov 2002 10:15:55 GMT (envelope-from timbo@dansat.data-plan.com) Received: (from timbo@localhost) by dansat.data-plan.com (8.12.6/8.12.6/Submit) id gAIAFt2d017422; Mon, 18 Nov 2002 10:15:55 GMT Date: Mon, 18 Nov 2002 10:15:55 +0000 From: Tim Bunce To: David Wheeler Cc: dbi-dev@perl.org, pgsql-interfaces@postgresql.org Subject: Re: DBD::PostgreSQL Message-ID: <20021118101554.GU1408@dansat.data-plan.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4i X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200211/45 X-Sequence-Number: 3293 On Sun, Nov 17, 2002 at 07:00:30PM -0800, David Wheeler wrote: > > * In DBD::Pg's dbdimp.c, the dbd_db_commit() function attempts a > commit, and if it's successful, it then starts another transaction. Is > this the proper behavior? The other DBDs I looked at don't appear to > BEGIN a new transaction in the dbd_db_commit() function. Many databases, like Oracle, automatically start a transaction at the server as soon as it's needed. The application doesn't have to do it explicitly. (DBD::Informix is probably a good example of a driver that needs to start transactions explicitly.) > * A similar question applies to dbd_db_rollback(). It does a rollback, > and then BEGINs a new transaction. Should it be starting another > transaction there? Drivers are free to defer starting a new transaction until it's needed. Or they can start one right away, but that may cause problems on the server if there are many 'idle transactions'. (Also beware that some databases don't allow certain statements, like some 'alter session ...', to be issued while a transaction is active. If that applies to Pg then you may have a problem.) > * How is DBI's begin_work() method intended to influence commits and > rollbacks?