[Catalyst] Initial connection pool issue with CDBI and MySQL

Dylan Vanderhoof DylanV at semaphore.com
Sat Jan 28 20:02:11 CET 2006


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)

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
);


Thanks,
Dylan

-----Original Message-----
From: Matt S Trout [mailto:dbix-class at trout.me.uk]
Sent: Saturday, January 28, 2006 7:49 AM
To: The elegant MVC web framework
Subject: Re: [Catalyst] Initial connection pool issue with CDBI and
MySQL


On Fri, Jan 27, 2006 at 04:40:56PM -0800, Dylan Vanderhoof wrote:
> I'm seeing some strange behavior on the first large chunk of requests
> coming into Catalyst.
> 
> The environment is a single catalyst page that has a bunch of img tags
> that call catalyst-handled dynamically generated images.
> 
> The first time the page is loaded, after an apache reload/restart, about
> half the images fail to load.  A refresh loads all of them (none are
> cached at any point), and all subsequent refreshes seem to work.
> 
> Any ideas what might be happening?  It doesn't appear to be a longterm
> problem, but I can't seem to figure out what is causing it for the
> initial request.  As best I can tell Catalyst/CDBI just doesn't have
> enough DB connections open to handle all the requests, but it doesn't
> seem to be like it should be failing for any, just being slower than
> subsequent requests.

Either you're opening a connection before apache fork, so they end up
sharing a $dbh, or you've got mysql_auto_reconnect set.

Under mod_perl, both CDBI and DBIC will result in one connection per apache
child, so "doesn't have enough" isn't really possible :)

-- 
     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