On 10/27/07, Peter Karman <[EMAIL PROTECTED]> wrote:
> I don't really see the point of caching Rose::DB objects myself. They're cheap
> to create, compared to DBI handles, and the only use I can see in caching them
> is to make use of the DBI handle they hold. In which case, why not just use 
> the
> DBI caching mechanism instead.

Well, cheap is relative.  Some people consider it wasteful to keep
creating new, essentially "identical" objects.

> Perrin originally suggested connect_cached() as a solution to a transaction 
> bug
> w.r.t Apache::DBI:

Caching the whole Rose::DB object should have a similar effect, right?

> Seems like the latest patch I sent achieves that with new_or_cached(). But 
> maybe
> the method name is what is misleading, since it suggests a 'new or cached
> Rose::DB object'. Maybe new_with_cached_dbh() or even:
>
>  new( use_cached_dbh => 1 )

Yeahl, some way to influence the connect method called is needed, but
I think that's orthogonal to caching Rose::DB objects.  I can imagine
all combinations of the two being useful in some circumstances.

> All that's really necessary is to call DBI->connect_cached() rather than
> DBI->connect(). That part seems pretty simple to me and ought to be a feature
> rather than requiring everyone who wants it to override init_dbh() in their
> local Rose::DB subclass.

Yes, definitely, only I don't want to hard-code the possible choices.
I suspect the DBI->connect() (or whatever) call will end up being
split out into its own method for easier customization.   I'll think
about it a bit more...

-John

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Rose-db-object mailing list
Rose-db-object@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rose-db-object

Reply via email to