[Catalyst] Shared database handles

Matt S Trout dbix-class at trout.me.uk
Mon May 8 01:58:06 CEST 2006


Len Jaffe wrote:
> 
> --- Eduardo Anuel <eanuel at gmail.com> wrote:
> 
> 
>> There is an explanation to the issue there and a
>> solution for Class
>> DBI, but sadly in my application I use mostly pure
>> DBI with the
>> Catalyst::Model::DBI module, 
> 
> Make sure that you're using Apache::DBI in your
> setup.pl.  Make sure that you don't make your DB
> connection in setup.pl, but do connect early in your
> handler. Make liberal use of connect_cached() and
> prepare_cached().

Actually, if you're already using Apache::DBI I'd recommend dumping it 
and seeing if that fixes the problem; it does all sorts of silly magic 
that breaks spectacularly on edge cases.

Apache::DBI is fine if you always call DBI->connect yourself and don't 
persist a $dbh anywhere. If not, it's almost-certain-death. Don't risk it.



More information about the Catalyst mailing list