Rollback
Posted in 1997
I have a two part question for you all:
1) When Online detects a deadlock, does it automatically rollback the
second transaction which will create the deadlock so that it can
release the locks allowing the other process to continue, or does
it expect the program to handle the error and issue the required
rollback ? (For reference, if DB2 detects a deadlock it rolls back
the transaction with the least amount of work to rollback).
2) Are there any SQL statements which will cause an automatic rollback
within a transaction ? For example:
BEGIN WORK
SELECT * FROM table WHERE col1="x";
UPDATE table2 SET col2="y" WHERE col1="burp";
INSERT INTO logtab VALUES ("burp-done"); COMMIT WORK;
If the insert failed because of, for example, lack of disk space,
would Online rollback the transaction, or expect the program to
handle the error ? I ask because it is obvious in the case of a lack
of disk space that the transaction cannot complete, therefore a
rollback by the engine would enable the locks held to be released
earlier than the program code handling it.
Cheers for your help,
--
Rick Ward
Senior DBA
Great Universal Stores Home Shopping
MANCHESTER, UK