Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: What constitutes a Transaction ?
Dave Young wrote:
>
> Hello, I am trying to confirm or deny exactly when a begin work and commit work
> actually takes place
When you first connect to the database you have started a transaction. The transaction ends (and a fresh one starts) when either you COMMIT WORK or ROLLBACK WORK. When you ROLLBACK everything you've done since the previous ROLLBACK or COMMIT (or since you connected to the database if you haven't yet issued a ROLLBACK or COMMIT) is rolled back.
When planning where to put COMMITs you should ask yourself what you'd want to happen if someone accidentally pulled the plug - how much of the data you've changed would you want to keep or discard? Quite often if you're manipulating data in a number of different tables you don't want a partially populated data structure, so you'd only COMMIT at the very end, safe in the knowledge that if you encounter an error the whole lot will be rolled back leaving nothing. Received on Thu Dec 19 1996 - 00:00:00 CST