Subject: | Problem handling prepared transactions |
Date: | Fri, 18 Jan 2008 11:23:27 -0500 |
To: | bug-DBD-Pg [...] rt.cpan.org |
From: | Damjan Pelemis <damjan [...] mailermailer.com> |
* DBD-Pg-1.49
* perl, v5.8.8 built for amd64-freebsd
* FreeBSD 6.1-RELEASE-p1 (also confirmed on Mac OS 10.5.1)
Creating a prepared transaction in PostgreSQL 8.1
PREPARE TRANSACTION named_transaction
COMMIT PREPARED named_transaction"
leaves the driver thinking there is an outstanding transaction
Here's a piece of code to reproduce:
use DBI;
my $dbh = DBI->connect('put your connect string here');
$dbh->begin_work();
my $sth = $dbh->prepare("PREPARE TRANSACTION ?");
$sth->execute('any_name');
$dbh->do("COMMIT PREPARED " . $dbh->quote('any_name'));
$dbh->begin_work();
$dbh->disconnect();
---------------
Results in: DBD::Pg::db begin_work failed: Already in a transaction at
short_break line 7.