[Catalyst] Initial connection pool issue with CDBI and MySQL
Dylan Vanderhoof
DylanV at semaphore.com
Sat Jan 28 21:23:55 CET 2006
That would make sense... Getting "Can't locate object method "db_Main" via package "Application::Model::CDBI".
Some searching showed that later versions of CDBI use connection instead of db_Main? That doesn't appear to be match the CDBI docs, nor does it work either...
What a pain. I'd switch to DBIC if I had time, but I'm afraid I simply don't right now. Might pursue it once I get something demonstrable out of this first.
Anyways, any ideas as to where my db_Main method might be hiding? =)
Thanks for the help!
-Dylan
-----Original Message-----
From: Matt S Trout [mailto:dbix-class at trout.me.uk]
Sent: Saturday, January 28, 2006 11:26 AM
To: The elegant MVC web framework
Subject: Re: [Catalyst] Initial connection pool issue with CDBI and
MySQL
On Sat, Jan 28, 2006 at 11:02:11AM -0800, Dylan Vanderhoof wrote:
> Ok, removing my DBI code didn't fully solve my problems. I'm still seeing commands out of sync.
>
> One question, this application is based on CDBI, but its using Authentication::Store::DBIC in the auth component. Is mixing CDBI and DBIC potentially causing the problem? (I didn't write the auth piece, so I haven't explored what that plugin is doing under the hood yet)
Nah, the ::DBIC store is written to work fine with both.
> Also, just to confirm, explicitly disabling auto_reconnect is done line this, correct?:
>
> __PACKAGE__->config(
> dsn => Application->config->{database}->{dsn},
> user => Application->config->{database}->{user},
> password => Application->config->{database}->{password},
> options => { mysql_auto_reconnect => 0 },
> relationships => 1
> );
That looks good. I suspect what's happening is the Loader is leaving a
database connection open. Try something like
sub new {
my $self = shift;
$self->NEXT::new(@_);
Some::CDBI::Class->db_Main->disconnect;
}
in your Model::CDBI to disconnect the connection at the end of the
component's setup process.
--
Matt S Trout Offering custom development, consultancy and support
Technical Director contracts for Catalyst, DBIx::Class and BAST. Contact
Shadowcat Systems Ltd. mst (at) shadowcatsystems.co.uk for more information
+ Help us build a better perl ORM: http://dbix-class.shadowcatsystems.co.uk/ +
_______________________________________________
Catalyst mailing list
Catalyst at lists.rawmode.org
http://lists.rawmode.org/mailman/listinfo/catalyst
More information about the Catalyst
mailing list