On 8/14/07, Michael Lackhoff <[EMAIL PROTECTED]> wrote:
> Well, my understandig was that if perl dies within a transaction it (or
> DBI) would do a rollback, from your answer I guess this is not the case.

No.  Your database will do it if you cut the connection and there is
uncommitted work, but perl or DBI won't do a rollback just because you
called die.  Remember, in a persistent environment like mod_perl, die
doesn't stop the perl interpreter or cut the database connection.

> > automatic rollback in a cleanup handler when running mod_perl.
>
> do you have any pointer on how this is done (correctly)?

   $r->push_handlers(PerlCleanupHandler => sub {
       MyApp::DB->rollback();
   });

I don't know what the proper way to get a database handle is in your
setup, but all you need to do is get one and call rollback.

> How do I manipulate the "isolation level"?

It depends on your database.  What database are you using?

> I thought the begin_work would set it as it should be.

It should start a transaction, but isolation level is a higher-level concept.
http://en.wikipedia.org/wiki/Isolation_level

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

Unless you open a handle during server startup and try to keep it, it
will not be shared between processes.  There could be something going
on with your closure stuff there if you do that during startup.  The
more likely answer though is that you just have your database in a
"READ UNCOMMITTED" (aka dirty read) isolation level and the handles
are not shared.

I will leave it for someone else to comment on the way you're managing
your database handles because I don't have enough first-hand
experience with what you're doing there to give you good advice.

- Perrin

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