[Catalyst] getting the db connection used by catalyst

Matt S Trout dbix-class at trout.me.uk
Wed Oct 4 15:12:35 CEST 2006


Daniel McBrearty wrote:
> I have. Could do it either way, but on the whole I prefer to seperate the two.
> 
> Even if I did that, I think I'd have the same question - how to get a
> connection without creating a new one.

$storage->dbh

DO NOT CACHE THAT

Grab it each time, then you benefit from all of DBIC's reconnection magic.

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