Jonathan Vanasco wrote:
This shouldn't be an issue in a non-ApacheDBI situation, because you'd
die on the RaiseError and never commit.
This shouldn't be an issue in an Apache::DBI situation either, if you
didn't start out with AutoCommit = 1. When you have AutoCommit turned
off, it will do a rollback automatically at the end of every request.
You could manually push that cleanup handler, or you could connect with
AutoCommit = 0 and switch it to 1 after. Look at the Apache::DBI code
to see the details.
2 - would it be possible to catch the die on a RaiseError, and have
a setting to issue an explicit rollback if wanted?
Sure, you can catch it like any other exception. I think you'll find
that when it dies it goes back to the original settings, i.e. AutoCommit
0. I thought it would also do a rollback on an error, but maybe not.
- Perrin
- Re: Apache::DBI question Perrin Harkins
-