On Aug 15, 2007 3:49 PM, Tim Bunce <[EMAIL PROTECTED]> wrote:
> On Wed, Aug 15, 2007 at 01:06:01PM -0500, Graham Barr wrote:
> >
> > Rose::DB does not know that the $dbh it get back from connect is not a
> > newly connected handle. As a result is still goes ahead and calls init_dbh
> > which will set all the dbh attributes to the defaults.
>
> The standard approach I recommend is to check for the existence of a
> private attribute:
>
>     $dbh = DBI->connect_cached(...);
>     unless ($dbh->{private_foo_bar}) {
>         # is new connection
>         ...
>         $dbh->{private_foo_bar} = ...some truee value...
>     }

This is the approach I've taken in Rose::DB 0.737, soon to be released...

-John

-------------------------------------------------------------------------
SF.Net email is sponsored by:
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services
for just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
Rose-db-object mailing list
Rose-db-object@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rose-db-object

Reply via email to