Re: transaction question

From: J L Joslin <jljoslin_at_cris.com>
Date: 1996/09/13
Message-ID: <3238d570.313792471_at_news.concentric.net>#1/1


On Thu, 12 Sep 1996 20:21:59 GMT, chuckh_at_dvol.com (Chuck Hamilton) wrote:

>If a statement fails due to the "rollback segment too small" error,
>won't that force the entire transaction to be rolled back?

Yes, it will.

>Assume I do the following....
>
>DELETE...
>INSERT...
>COMMIT;
>
>If the INSERT fails, won't that rollback the DELETE too?

Yes, it will.

> And then COMMIT an empty transaction?

No, it won't. The rollback action performs an implicit commit. But, issuing a "COMMIT" will simply terminate the current transaction. It won't have any work to save, but it won't hurt anything either.

If you are using PL/SQL or PRO*C, your exception section should handle the cleanup. In PL/SQL it would look like:

BEGIN

  DELETE...
  INSERT...
  COMMIT...

EXCEPTION
WHEN ... {ERROR TYPE} ...
.
.
.

ROLLBACK
.
.
.

END; An error in any of the three statements in the main block would trigger the exception block and the remaining statements would not be executed anyway.

Jim Joslin Received on Fri Sep 13 1996 - 00:00:00 CEST

Original text of this message