X-Original-To: pgsql-general@postgresql.org Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id A62FC475FEE for ; Mon, 3 Feb 2003 09:21:00 -0500 (EST) Received: from biglumber.com (biglumber.com [207.228.252.42]) by postgresql.org (Postfix) with SMTP id 58F42475DC5 for ; Mon, 3 Feb 2003 09:19:25 -0500 (EST) Received: (qmail 15203 invoked from network); 3 Feb 2003 14:15:29 -0000 Received: from biglumber.com (HELO localhost) (207.228.252.42) by 0 with SMTP; 3 Feb 2003 14:15:29 -0000 From: greg@turnstep.com To: pgsql-general@postgresql.org Subject: Re: DBI driver and transactions X-PGP-Fingerprint: 2529 DF6A B8F7 9407 E944 45B4 BC9B 9067 1496 4AC8 In-Reply-To: <5.1.0.14.1.20030203182438.02cec830@mbox.jaring.my> Date: Mon, 3 Feb 2003 14:15:29 -0000 X-Mailer: JoyMail 1.36 Message-ID: <8c57f32fbc49613858db7e564b49e7e3@biglumber.com> X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200302/109 X-Sequence-Number: 36863 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 > Yep before you disconnect/quit, you're supposed to finish active > statements. e.g. prepare, execute, use up results, or call finish if you > don't need the rest of the results. Exactly. The error only appears after you have done a prepare *and* a select, with no concomitant finish or fetching. Here is a code sample: use DBI; my $dbh = DBI->connect("dbi:Pg:dbname=foobar", $user, $pass, {AutoCommit=>0, RaiseError=>1, PrintError=>0}); my $sth = $dbh->prepare("SELECT * FROM baz WHERE waldo > ?"); my $count = $sth->execute(120); ## Exiting here will cause the warning described if ($count eq "0E0") { $sth->finish(); } else { my $info = $sth->fetchall_arrayref({}); ## Do something with info... } ## Exiting is now safe: commit and disconnect are separate issues... - -- Greg Sabino Mullane greg@turnstep.com PGP Key: 0x14964AC8 200302030912 -----BEGIN PGP SIGNATURE----- Comment: http://www.turnstep.com/pgp.html iD8DBQE+PnomvJuQZxSWSsgRAhTMAKDLEzXWlGdEQJWKZ72qafkkBL9PRQCfVuh3 uFGqo2u41jwQFONCT9VBAks= =axjF -----END PGP SIGNATURE-----