在COBOL批處理程序中,性能方面有哪些更好?批處理DB2執行COMMIT/ROLLBACK和ROLLBACK以SAVEPOINT
隨着承諾:
IF SW-NEW-TRANSACT
EXEC SQL
COMMIT
END-EXEC
END-IF.
PERFORM SOMETHING
THRU SOMETHING-EXIT.
IF SW-ERROR
EXEC SQL
ROLLBACK
END-EXEC
END-IF.
隨着同步點:
IF SW-NEW-TRANSACT
EXEC SQL
SAVEPOINT NAMEPOINT ON ROLLBACK RETAIN CURSORS
END-EXEC
END-IF.
PERFORM SOMETHING
THRU SOMETHING-EXIT.
IF SW-ERROR
EXEC SQL
ROLLBACK TO SAVEPOINT NAMEPOINT
END-EXEC
END-IF.
因此,這是每個案件的具體決定,並沒有一般的指導方針,對嗎? – user823959 2012-04-10 16:27:41
@ user823959請參閱編輯... – NealB 2012-04-10 17:05:50