Re: rollback ineffective with AutoCommit enabled in do_transaction?

[prev] [thread] [next] [Date index for 2005/05/22]

From: Perrin Harkins
Subject: Re: rollback ineffective with AutoCommit enabled in do_transaction?
Date: 17:17 on 22 May 2005
Lonely Rolling Star wrote:
> 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 sounds like the best solution is to use a DBI error handler so you 
can easily tell when you have a DBI error vs. some other kind.  For 
example, David Wheeler's Exception::Class::DBI:
http://search.cpan.org/~dwheeler/Exception-Class-DBI-0.92/lib/Exception/Class/DBI.pm

Then you only issue an explicit rollback when you get a non-DBI error.

- Perrin

(message missing)

Re: rollback ineffective with AutoCommit enabled in do_transaction?
Perrin Harkins 17:17 on 22 May 2005

Generated at 15:51 on 25 May 2005 by mariachi v0.52