Skip Menu |
 

This queue is for tickets about the Class-DBI-Loader CPAN distribution.

Report information
The Basics
Id: 31212
Status: open
Priority: 0/
Queue: Class-DBI-Loader

People
Owner: Nobody in particular
Requestors: WMCKEE [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 0.34
Fixed in: (no value)



Subject: CDBI::Loader::Generic does not disconnect from empty database
Download (untitled) / with headers
text/plain 308b
When connecting to a new or empty SQLite database, the connection to the database is never broken due to the lines in new() which loop over the list of tables to call disconnect. This leaves the database handle open thus generating warnings from DBI. William -- Knowmad Technologies http://www.knowmad.com
From: DMAKI [...] cpan.org
Can you please come up with a failing test case? Thanks, --d
From: WMCKEE [...] cpan.org
Download (untitled) / with headers
text/plain 714b
On Mon Dec 10 04:37:49 2007, DMAKI wrote: Show quoted text
> Can you please come up with a failing test case?
This appears to be an issue in DBD::SQLite v1.14. I've attached a test script (test-cdbi.pl) which creates the following output running with that version: closing dbh with active statement handles at /usr/local/share/perl/5.8.8/Class/DBI/Loader/SQLite.pm line 110. When I downgrade DBD::SQLite to v1.12, there is no output. I've also attached a test script that only uses DBI (test-dbi.pl). This does not generate errors under either version so I wonder if there is something that CDBI is doing that is causing the statement handler to remain open. Thanks, William -- Knowmad Technologies http://www.knowmad.com
Download test-cdbi.pl
text/x-perl 371b
#!/usr/bin/perl use strict; use warnings; use Class::DBI::Loader; use Data::Dumper; my $db_file = '/tmp/test.dat'; unlink $db_file if -e $db_file; # remove the table my $dsn = "dbi:SQLite:dbname=$db_file"; warn "\nStarting loader...\n"; my $loader = Class::DBI::Loader->new( dsn => $dsn, namespace => 'Phonefinder', ); warn Dumper($loader->{CLASSES});
Download test-dbh.pl
text/x-perl 462b
#!/usr/bin/perl use strict; use warnings; use DBI; use Data::Dumper; my $db_file = '/tmp/test.dat'; my $db_table = 'Phones'; # re-create the table unlink $db_file if -e $db_file; my $dsn = "dbi:SQLite:dbname=$db_file"; my $dbh = DBI->connect($dsn, '', '', {}); my $sql = "SELECT * FROM sqlite_master"; my $sth = $dbh->prepare($sql); my $rv = $sth->execute(); my $ary_ref = $sth->fetchrow_arrayref; $sth->finish; $dbh->disconnect; print Dumper($ary_ref);
Download (untitled) / with headers
text/plain 473b
On Wed Dec 12 00:39:56 2007, WMCKEE wrote: Show quoted text
> This does not generate errors under either version so I wonder if there is > something that CDBI is doing that is causing the statement handler to > remain open.
Oops, this statement is not correct. Looks like there's an issue in DBD::SQLite. I've already posted a ticket about statement handles staying active[1]. William [1] http://rt.cpan.org/Ticket/Display.html?id=31239 -- Knowmad Technologies http://www.knowmad.com


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.