Subject: | new 'DESTROY failed' with change from DBD::Sybase 1.10 to 1.15 |
Date: | Fri, 12 Jun 2015 13:43:45 +0000 |
To: | "bug-DBD-Sybase [...] rt.cpan.org" <bug-DBD-Sybase [...] rt.cpan.org> |
From: | "Scott R. McCormick" <Scott.McCormick [...] silabs.com> |
Hello,
First off, thanks for the great module.
We are upgrading to perl 5.20.2 (DBD::Sybase 1.15 and DBI 1.633) and are seeing a new error:
DBD::Sybase::db DESTROY failed: Server message number=3903 severity=16 state=1 line=2 server=XXXXXXXXX text=The ROLLBACK TRANSACTION request has no corresponding BEGIN TRANSACTION. Server message number=3903 severity=16 state=1 line=2 server=XXXXXXXXX text=The ROLLBACK TRANSACTION request has no corresponding BEGIN TRANSACTION
System/version info:
- Perl: v5.20.2 built for x86_64-linux (reproduced on CentOS 5.11 and RHEL 6.6)
- DBD::Sybase 1.15
- DBI 1.633
- FreeTDS 0.64 (reproduced on 0.91 as well)
- DB is SQL Server 2008 R2
This error doesn't appear with perl 5.8.8 (DBD::Sybase 1.10 and DBI 1.616) with all other configs (freetds, OS, DB, etc.) the same.
DBI trace does show some internal errors about rollback(), but this doesn't cause the DESTROY to fail in perl 5.8.8 like it does in 5.20.2.
Also the error doesn't appear if we use one of the following options:
- AutoCommit = 1
- AutoCommit = 0 and put 'BEGIN TRAN;' before our SQL and explicitly disconnect()
- Use PrintError = 0 in our database lib DESTROY sub (masks the DESTROY failed error) - that code not shown here.
We are going with the 3rd option for now, but this seems like a bug.
Code to reproduce error:
#!/usr/local/bin/perl5.20.2 -I./../
use strict;
use warnings;
use DBI;
BEGIN {
my $root;
$root = $0;
$root =~ s/^(.*)\/.*$/$1/;
chdir($root);
}
my $dbh = DBI->connect('dbi:Sybase::server=xxxxxx:1433;port=1433','user','xxxxxxxx',{RaiseError=>0,AutoCommit=>0});
my $sql = "SELECT TOP 1 XMLFileName FROM tblHIXMLFiles;";
#my $sql = "BEGIN TRAN; SELECT TOP 1 XMLFileName FROM tblHIXMLFiles;";
my $sth = $dbh->prepare($sql);
$sth->execute();
while(my ($request_xml_filename)=$sth->fetchrow_array) {
print "$request_xml_filename\n";
}
#$dbh->disconnect();
Output with DBI_TRACE set to 5 is attached.
Thank you,
Scott
Message body is not shown because it is too large.
Message body is not shown because sender requested not to inline it.