Re: rollback ineffective with AutoCommit enabled in do_transaction?
[prev]
[thread]
[next]
[Date index for 2005/05/20]
At 2:27 PM -0400 5/20/05, Perrin Harkins wrote:
>On Friday 20 May 2005 11:30 am, Lonely Rolling Star wrote:
>> If I comment it out, I don't see anything in the trace about the
>> rollback, but the part of that transaction before the error (the
>> first create) doesn't happen. The table is empty in either case.
>
>Well, it sounds like you can leave out the explicit rollback then, if all you
>wanted to do was rollback on errors. Good to know.
It occurred to me that that's only true for database errors. I want
the rollback in there in case an error is triggered in the perl code
in the transaction. I can quiet the error message by testing to make
sure that AutoCommit is still false before I attempt the rollback.
> > It appears to be only in the error case. In the non-error case, AC is
>> false at the end of the do_commit function. In the error case AC is
>> true again immediately after the eval.
>
>Sounds like DBI resets it after errors then.
I guess so.
--
Aneel Nazareth -- http://eye-of-newt.com/nazareth --
|
Re: rollback ineffective with AutoCommit enabled in do_transaction?
Lonely Rolling Star 20:26 on 20 May 2005
|