09 January 2007

sqlplus commit-on-exit?

ACHTUNG: Did you know that SQL*Plus issues a COMMIT when you exit? This has nothing to do with the AUTOCOMMIT setting, which will automatically commit after every statement in sqlplus.

If you issue a graceful exit (via the "exit" or "quit" command), sqlplus will always issue a commit. However, if you were to be ungracefully disconnected, for example by closing your terminal window, then PMON will issue a rollback like it does with any other disconnected session.

Here's a small oracle-l thread about it as well. Google also turns up an Eddie Awad post on it. Of course it turns out that this is a documented "feature":

"Regardless of the AUTOCOMMIT setting, changes are committed when you exit SQL*Plus successfully."

No comments:

Post a Comment