Rollback or commit transactions


In natural/db2 is there a statement that i could say the transaction starts here and based on some condition it rollback or commits transactions.

There are 2 transactions say A, B.

based on one of the flag in ‘B’ i have to either commit or rolback the transactions in A and B together.
I used BACKOUT TRANSACTION but it just rollbacks only the ones done in ‘B’ not in A.

Requirement is either commit both A and B or Rollback both A and B.

Please let me know.
Thanks in advance.


Education, Education, Education.

It “reads” as if you have one logical transaction, not two. If you have a COMMIT after the maintenance commands in A, surprise, they are committed, and you can no longer ROLLBACK those commands.


Thanks Steve.

I dont do any commit in transaction A. I think it auto commits.
Is there a way to avoid it.

My understanding is that in Natural for DB2 a terminal I/O causes a Commit. Check for a terminal I/O in “A”.

it results in a commit transaction