Skip Menu | You are currently an anonymous guest. | Login | Return to Main | About rt.cpan.org
 

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

X Report information
Id: 16100
Status: resolved
Left: 0 min
Priority: 0/0
Queue: DBIx-Class-Loader

Owner: BLBLACK <blblack [...] gmail.com>
Requestors: scriptyrich [...] yahoo.co.uk
Cc:
AdminCc:

Severity: Normal
Broken in: 0.09
Fixed in: 0.11



X History Display mode: Brief headersFull headers
#   Thu Nov 24 18:07:45 2005 guest - Ticket created  
Subject: Warning issued by DBIx::Class::Loader::mysql with auto commit enabled
[text/plain 1.1k]
Hi

I'm using DBIx::Class::Loader::mysql (0.09) with auto commit enabled, and get the following warning emitted:

"Issuing rollback() for database handle being DESTROY'd without explicit disconnect() at /usr/lib/perl5/site_perl/5.8.0/DBIx/Class/Loader/Generic.pm line 208."

Looks to me like DBIx::Class::Loader::mysql::_table_info() needs an explicit disconnect before returning, eg:

sub _table_info {
my ( $self, $table ) = @_;
my $dbh = DBI->connect( @{ $self->{_datasource} } ) or croak($DBI::errstr);

# MySQL 4.x doesn't support quoted tables
my $query = "DESCRIBE $table";
my $sth = $dbh->prepare($query) or die("Cannot get table status: $table");
$sth->execute;
my ( @cols, @pri );
while ( my $hash = $sth->fetchrow_hashref ) {
my ($col) = $hash->{Field} =~ /(\w+)/;
push @cols, $col;
push @pri, $col if $hash->{Key} eq "PRI";
}
$dbh->disconnect; #<<<<<<<<< HERE
croak("$table has no primary key") unless @pri;
return ( \@cols, \@pri );
}

Thanks for all the work you guys are doing with DBIx::Class and, more importantly, Catalyst - great stuff!

Cheers,
Richard Evans
#   Tue Jan 31 18:58:36 2006 BLBLACK - Taken  
#   Tue Jan 31 19:00:15 2006 BLBLACK - Correspondence added  
[text/plain 128b]

Resolved in 0.11. Sorry for the delayed reply, but I've been unable to
log into rt.cpan.org with my PAUSE id all this time. :)
#   Tue Jan 31 19:00:15 2006 RT_System - Status changed from 'new' to 'open'  
#   Tue Jan 31 19:00:16 2006 BLBLACK - Status changed from 'open' to 'resolved'  
#   Tue Jan 31 19:01:19 2006 BLBLACK - Status changed from 'resolved' to 'open'  
#   Tue Jan 31 19:02:50 2006 BLBLACK - Status changed from 'open' to 'resolved'  
#   Tue Jan 31 19:02:51 2006 BLBLACK - Fixed in 0.11 added