Re: Select for update
[prev]
[thread]
[next]
[Date index for 2004/07/19]
Perrin Harkins wrote:
> I'm wary of anything that uses sub refs since I had problems with
> accidental closures and unexpected return() behavior when using the
> Error module.
You're right to be wary, but I think I fully address (and, IMHO, solve) the
accidental closure problem at the aformentioned Wiki page.
> In my opinion, the simplest thing by far is to simply
> not turn on AutoCommit when using a database with transactions. Then
> there's no need to do acrobatics just to turn it off for a section.
I agree totally. I always keep AutoCommit turned off; however, one still has
to commit the transaction, check for errors, and rollback the transaction and
croak if there are any errors. I think do_transaction() is still the best way
of handling all of those auxiliary tasks in a reusable manner.