[Catalyst] Shared database handles

Perrin Harkins perrin at elem.com
Mon May 8 05:30:18 CEST 2006

Matt S Trout wrote:
> 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.

Can you be more specific?  Apache::DBI is a tiny module, very similar to 
DBI->connect_cached, but also disabling $dbh->disconnect.  Keeping your 
own persistent copy of a database handle would prevent it from doing the 
pings and automatic rollbacks it would otherwise do to help you, but I 
don't see how it would hurt you.  It actually avoids caching connections 
during startup, which seems to be the problem here.

If you already have a system for caching database handles, you don't 
need Apache::DBI, but it's not a dangerous module.  If you've discovered 
some sort of undocumented issue it causes with DBI, please report it.

- Perrin

More information about the Catalyst mailing list