On 14.08.2007 17:50 Perrin Harkins wrote:

>> do you have any pointer on how this is done (correctly)?
> 
>    $r->push_handlers(PerlCleanupHandler => sub {
>        MyApp::DB->rollback();
>    });

Thanks! That's exactly what I needed. I found already that there is a
PerlCleanupHandler directive in httpd.conf but your code shows how to do
it from within only those requests that need it, great!
Only question: Is it really possible to call rollback as a class method
or do I have to call it on the specific object that started the transaction?

>> How do I manipulate the "isolation level"?
> 
> It depends on your database.  What database are you using?

SQLite, but if at all possible I would set it in some generic way with
RDBO because I might well change the database in the future.

> 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, your answer was really great help, thanks for taking the time!
If now some kind soul would share his/her init_db() that'll be my day ;-)

- Michael
(already trying for two weekends to get this right)

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