Return-Path: Delivered-To: apmail-perl-modperl-archive@www.apache.org Received: (qmail 68207 invoked from network); 16 Jan 2006 15:08:47 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 16 Jan 2006 15:08:47 -0000 Received: (qmail 41594 invoked by uid 500); 16 Jan 2006 15:08:35 -0000 Delivered-To: apmail-perl-modperl-archive@perl.apache.org Received: (qmail 41533 invoked by uid 500); 16 Jan 2006 15:08:35 -0000 Mailing-List: contact modperl-help@perl.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list modperl@perl.apache.org Received: (qmail 41491 invoked by uid 99); 16 Jan 2006 15:08:34 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 16 Jan 2006 07:08:34 -0800 X-ASF-Spam-Status: No, hits=1.4 required=10.0 tests=SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (asf.osuosl.org: 207.114.11.197 is neither permitted nor denied by domain of perrin@elem.com) Received: from [207.114.11.197] (HELO ns1.plusthree.com) (207.114.11.197) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 16 Jan 2006 07:08:34 -0800 Received: from [10.0.1.201] ([69.10.70.170]) (authenticated bits=0) by ns1.plusthree.com (8.13.1/8.13.1) with ESMTP id k0GF7rWA005641 (version=TLSv1/SSLv3 cipher=RC4-MD5 bits=128 verify=NO); Mon, 16 Jan 2006 10:07:54 -0500 Subject: Re: Apache::DBI and DBD::Pg From: Perrin Harkins To: Jeremy Nixon Cc: "modperl@perl.apache.org" In-Reply-To: References: <20060113235346.GB15634@yi.org> <1137367623.4700.3.camel@localhost.localdomain> <1137384843.4700.15.camel@localhost.localdomain> Content-Type: text/plain Date: Mon, 16 Jan 2006 10:07:59 -0500 Message-Id: <1137424079.5625.5.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Evolution 2.0.4 (2.0.4-7) Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N On Mon, 2006-01-16 at 05:11 +0000, Jeremy Nixon wrote: > I'm not caching across requests; I have a cleanup handler that > calls rollback and disconnect, and then nukes my entire db wrapper from > orbit. You keep the handle in a global and then clear it from a cleanup handler? That should work, but I've had better luck using pnotes for this kind of thing, since no explicit clearing is needed. > On the other hand, I have some funky code going on after trying to deal > with DBI's handling of transactions -- I don't want AutoCommit, but it > seems to be impossible to do "set transaction isolation level serializable" > without it, because DBI won't open a transaction if you send that command, > but won't let you send a "begin" yourself, and effectively won't let you > call ->begin unless AutoCommit is on. My experience has been that there is no need to explicitly call begin, at least with MySQL InnoDB tables. I use the "read committed" isolation level, and switching from AutoCommit 1 to 0 seems to have the same effect as issuing a begin. It is effectively always inside of a transaction. If you have a small enough example of code that shows how you manage your database handles, you're welcome to post it here and I'll take a look at it. - Perrin