[Dbix-class] Caching connections

Matt S Trout dbix-class at trout.me.uk
Sun Apr 30 03:10:09 CEST 2006


Dan Horne wrote:
> According to the docs
> 
> "Note that DBIx::Class::Schema does not cache connections for you. If you
> use multiple connections, you need to do this manually."
> 
> As I'm using DBIx::Class under FastCGI, I'd like to cache my connection with
> DBI's connect_cached connection method. Is there a way that I can do this?

"Don't do that"

More seriously, just keep the $schema object around somewhere - much simpler 
approach and works fine. That's basically what Catalyst::Model::DBIC::Schema 
does, if you want to use that as a reference (I tend to deploy most of my 
Catalyst stuff under FastCGI)

-- 
      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 Dbix-class mailing list