[Omaha.pm] Autocommmit?

Jay Hannah jhannah at omnihotels.com
Tue Feb 21 11:09:42 PST 2006


> Is there a best-practices approach to going one way or the 
> other? I'm trying to think of a situation where I wouldn't 
> want an autocommit.

Well, you can't AutoCommit any time you want to control transactions,
which would be any time you're doing multiple, related SQL operations.
e.g.: Only do these 5 SQL statements IF all 5 of them work. If any of
them fail, don't do ANY. In those cases, you need to explicitly control
commit's/rollback's in your program at the appropriate times.

In general I vote for AutoCommit off. I'd much rather accidentally NOT
commit something when my program is wrong than accidentally commit
something I didn't mean to commit yet. The opposite is also arguable.

j


More information about the Omaha-pm mailing list