Skip Menu |

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

Report information
The Basics
Id: 16100
Status: resolved
Priority: 0/
Queue: DBIx-Class-Loader

People
Owner: blblack [...] gmail.com
Requestors: scriptyrich [...] yahoo.co.uk
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 0.09
Fixed in: 0.11



Subject: Warning issued by DBIx::Class::Loader::mysql with auto commit enabled
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
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. :)