On 15.08.2007 18:47 Perrin Harkins wrote:

> I have a guess.  Looking at the new code in Apache::DBI, I see that it
> now tries to reset the state of the $dbh every time you call
> connect().  This probably breaks the begin_work() state.
> 
> I'm not sure why this was added, since it seems like this only needs
> to happen in the cleanup handler, not on every connect call.  I'll
> talk to the maintainer about it.
> 
> Meanwhile, try commenting out the call to reset_startup_state() in
> your Apache::DBI source and see if that fixes the problem.

With all my test- and debug-code all over the place it is difficult to
tell exactly but I found 2 things, one in favour of your guess one
against it:
- I get different values for AutoCommit depending if I print
  $db->dbh->{AutoCommit} (empty) or if I look into the output of
  DBI->trace (gives 1) but perhaps I am just not able to read the
  output correctly.
- Against: I also tried the variant with do_transaction() where it
  shouldn't depend on the magic of Apache::DBI. But even then the
  transaction is not rolled back in certain circumstances.
  Commenting out reset_startup_state() makes no difference here.
  I couldn't check yet the other example I posted here with the
  unintentional rollback.

My present state is that it looks as if it is not enough that the dbh is
shared to identify a transaction, it seems to be necessary that the
whole MyApp::DB object is shared too.
I could boil down one case where a rollback fails although the dbh is
the same (seen with a "warn $db->dbh;") because of Apache::DBI but the
$db is not the same. As soon as I also share the DB object ($db)
everything works perfectly.
It is still a mystery for me since transactions/rollback/commit should
only have to do with the dbh not with the rest of the DB object but my
findings suggest otherwise.

- Michael
(hoping not to bore too much with such a long thread but it is really
important for me)

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