Subject: | DBD::SQLITE Error Report |
Date: | Sat, 28 Oct 2006 19:02:52 -0400 |
To: | bug-DBD-SQLite [...] rt.cpan.org |
From: | "Private and Confidential" <nn6eumtr [...] gmail.com> |
The "closing dbh with active statement handles" problem still exists in
v1.13 of the module.
This sample program shows the bug:
#!/usr/local/bin/perl -w
use DBI;
use strict;
my $dbh = DBI->connect("dbi:SQLite:dbname=testdb", '', '', {RaiseError => 1,
AutoCommit => 0});
my $sql = "SELECT * FROM main";
my $sth = $dbh->prepare($sql) or warn $dbh->errstr;
$sth->execute or warn $dbh->errstr;
while(my @row = $sth->fetchrow_array) {
#print join(', ', @$row) . "\n";
}
$sth->finish or warn $dbh->errstr;
#undef $sth;
$dbh->rollback or warn $dbh->errstr;
$dbh->disconnect or warn $dbh->errstr;
If you uncomment the "undef $sth" line then the error goes away. I've used
DBI with Oracle and Sybase, and I believe sth->finish should release the
handle and it shouldn't require the explicit undef.
Perl -v output is:
Summary of my perl5 (revision 5 version 8 subversion 8) configuration:
Platform:
osname=linux, osvers=2.6.8-3-686, archname=i686-linux-thread-multi-64int
uname='linux debian 2.6.8-3-686 #1 sat jul 15 10:32:25 utc 2006 i686
gnulinux '
config_args=''
hint=recommended, useposix=true, d_sigaction=define
usethreads=define use5005threads=undef useithreads=define
usemultiplicity=define
useperlio=define d_sfio=undef uselargefiles=define usesocks=undef
use64bitint=define use64bitall=undef uselongdouble=undef
usemymalloc=n, bincompat5005=undef
Compiler:
cc='gcc', ccflags ='-fno-strict-aliasing -pipe
-Wdeclaration-after-statement -I/usr/local/include -D_LARGEFILE_SOURCE
-D_FILE_OFFSET_BITS=64',
optimize='-O2',
cppflags='-fno-strict-aliasing -pipe -Wdeclaration-after-statement
-I/usr/local/include'
ccversion='', gccversion='3.4.4 20050314 (prerelease) (Debian 3.4.3-13)',
gccosandvers=''
intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=12345678
d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12
ivtype='long long', ivsize=8, nvtype='double', nvsize=8, Off_t='off_t',
lseeksize=8
alignbytes=4, prototype=define
Linker and Libraries:
ld='gcc', ldflags =' -L/usr/local/lib'
libpth=/usr/local/lib /lib /usr/lib
libs=-lnsl -ldl -lm -lcrypt -lutil -lpthread -lc
perllibs=-lnsl -ldl -lm -lcrypt -lutil -lpthread -lc
libc=/lib/libc-2.3.2.so, so=so, useshrplib=true, libperl=libperl.so
gnulibc_version='2.3.2'
Dynamic Linking:
dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E
-Wl,-rpath,/usr/local/lib/perl5/5.8.8/i686-linux-thread-multi-64int/CORE'
cccdlflags='-fpic', lddlflags='-shared -L/usr/local/lib'
Characteristics of this binary (from libperl):
Compile-time options: MULTIPLICITY PERL_IMPLICIT_CONTEXT
PERL_MALLOC_WRAP USE_64_BIT_INT USE_ITHREADS
USE_LARGE_FILES USE_PERLIO USE_REENTRANT_API
Built under linux
Compiled at Oct 22 2006 10:34:53
@INC:
/usr/local/lib/perl5/5.8.8/i686-linux-thread-multi-64int
/usr/local/lib/perl5/5.8.8
/usr/local/lib/perl5/site_perl/5.8.8/i686-linux-thread-multi-64int
/usr/local/lib/perl5/site_perl/5.8.8
/usr/local/lib/perl5/site_perl
The version of SQLITE I am using is 3.3.8.