Skip Menu |

This queue is for tickets about the SQL-Translator CPAN distribution.

Report information
The Basics
Id: 35868
Status: resolved
Priority: 0/
Queue: SQL-Translator

People
Owner: Nobody in particular
Requestors: chris+rt [...] chrisdolan.net
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: (no value)
Fixed in: 0.11011



Subject: SQL::Translator::Parser::DBI should not disconnect $dbh
In my Catalyst/DBIx::Class application, I generate and apply sql diffs automatically at startup. However, the SQL::Translator::Parser::DBI class calls "$dbh->disconnect" which tears down my database connection prematurely. That class should take a RAII approach and make the caller take care of disconnecting the database.
On Wed May 14 03:05:39 2008, CDOLAN wrote: Show quoted text
> In my Catalyst/DBIx::Class application, I generate and apply sql diffs > automatically at startup. However, the SQL::Translator::Parser::DBI > class calls "$dbh->disconnect" which tears down my database connection > prematurely. That class should take a RAII approach and make the caller > take care of disconnecting the database.
Looking more closely at the code, the best fix is probably this: Old: $dbh->disconnect if defined $dbh; New: $dbh->disconnect if defined $dbh && ! defined $args->{'dbh'};