DB2 Version 10.1 for Linux, UNIX, and Windows

Transactions and exceptions (PL/SQL)

A trigger is always executed as part of the same transaction within which the triggering statement is executing.

If no exceptions occur within the trigger code block, the effects of data manipulation language (DML) within the trigger are committed only if the transaction that contains the triggering statement commits. If the transaction is rolled back, the effects of DML within the trigger are also rolled back.

A DB2® rollback can only occur within an atomic block or by using an UNDO handler. The triggering statement itself is not rolled back unless the application forces a rollback of the encapsulating transaction.

If an unhandled exception occurs within the trigger code block, the calling statement is rolled back.