Re: Using outside DB handles
[prev]
[thread]
[next]
[Date index for 2005/07/06]
On Wed, Jul 06, 2005 at 02:05:43PM -0400, Brett Sanger wrote:
> My agency has a package that returns a DB handle. Any access to the db
> uses this package to connect, so any and all of our DB accesses pass
> through a common configuration point.
>
> It's worked wonderfully...until I try to implement CDBI.
>
> Now I can have one master CDBI module and get the connections there, but
> that's still one duplication, and we do have non-CDBI code out there.
> The CDBI docs tell me how to insert my own handle, but wants that handle
> to be an Ima::DBI.
>
> So I'm looking into the compatibility there. Browsing Ima::DBI, it
> appears that it will let me snag a handle out of it via db_*(), so I can
> change the common DBH accessor to pull from an Ima::DBI if needed. Does
> anyone consider this a bad idea? Does anyone have experience to share
> here?
Works beautifully - in the case of Class::DBI it's always ->db_Main.
I've done this time and again and never run into any problems, so I reckon
it's a pretty safe bet.
--
Matt S Trout Website: http://www.shadowcatsystems.co.uk
Technical Director E-mail: mst (at) shadowcatsystems.co.uk
Shadowcat Systems Ltd.
|
|
Re: Using outside DB handles
Matt S Trout 18:17 on 06 Jul 2005
|