On 8/14/07, Michael Lackhoff <[EMAIL PROTECTED]> wrote:
> And to the second alternative, how do I have to setup RDBO with mod_perl
> to share a db (and dbh with it) for everything within one
> process/request but not across multiple processes?

The simplest way to do this is to leave everything as per the
defaults, and just use Apache::DBI.  The default init_db() method
looks like this:

    sub init_db { Rose::DB->new() }

If you just "use Apache::DBI" in your mod_perl process, then every
Rose::DB-derived object will get its own Rose::DB "db" object, but all
of those "db" objects within a single Apache child will share a single
DBI $dbh connection.

If you have your own Rose::DB subclass (as you probably should) then
just change init_db() to this in your common base casee:

    sub init_db { My::DB->new() }

Some more info here:

http://www.mail-archive.com/rose-db-object@lists.sourceforge.net/msg01139.html

-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