[Catalyst] Initial connection pool issue with CDBI and MySQL
Matt S Trout
dbix-class at trout.me.uk
Sat Jan 28 21:42:56 CET 2006
On Sat, Jan 28, 2006 at 12:23:55PM -0800, Dylan Vanderhoof wrote:
> 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...
Not true. ->connection is to set the connection, ->db_Main is to retrieve
the $dbh.
> 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? =)
> 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.
See where it says Some::CDBI::Class instead of Model::CDBI?
I meant it. Pick one of your table classes and call ->db_Main on that.
--
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/ +
More information about the Catalyst
mailing list