# Rollback or commit transactions

**URL:** <https://techcommunity.softwareag.com/t/rollback-or-commit-transactions/79110>\
**Category:** Forum\
**Tags:** Adabas-Natural, Natural, Natural-on-Mainframes, Natural-Database-and-TP-Monitor-Interfaces-on-Mainframes\
**Created:** [September 25, 2008, 11:54am UTC](https://techcommunity.softwareag.com/t/rollback-or-commit-transactions/79110 "2008-09-25T11:54:57Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jei1](https://avatars.discourse-cdn.com/v4/letter/j/48db29/32.png) [@Jei1](https://techcommunity.softwareag.com/u/Jei1)\
**Post date:** [September 25, 2008, 11:54am UTC](https://techcommunity.softwareag.com/t/rollback-or-commit-transactions/79110/1 "2008-09-25T11:54:57Z")

</div>

Hi,

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.

CALL A  
CALL 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.

~Jei

---

<div class="post-metadata">

**Author:** ![Steve\_Robinson](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/steve_robinson/32/107_2.png) [@Steve\_Robinson](https://techcommunity.softwareag.com/u/Steve_Robinson)\
**Post date:** [September 25, 2008, 5:49pm UTC](https://techcommunity.softwareag.com/t/rollback-or-commit-transactions/79110/2 "2008-09-25T17:49:25Z")

</div>

Education, Education, Education.

[http://techcommunity.softwareag.com/ecosystem/documentation/natural/nat424mf/dbms/db2\_sql.htm#db2\_sql](http://techcommunity.softwareag.com/ecosystem/documentation/natural/nat424mf/dbms/db2_sql.htm#db2_sql)

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.

steve

---

<div class="post-metadata">

**Author:** ![Jei1](https://avatars.discourse-cdn.com/v4/letter/j/48db29/32.png) [@Jei1](https://techcommunity.softwareag.com/u/Jei1)\
**Post date:** [September 25, 2008, 6:11pm UTC](https://techcommunity.softwareag.com/t/rollback-or-commit-transactions/79110/3 "2008-09-25T18:11:51Z")

</div>

Thanks Steve.

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

---

<div class="post-metadata">

**Author:** ![Ralph\_Zbrog](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/ralph_zbrog/32/78_2.png) [@Ralph\_Zbrog](https://techcommunity.softwareag.com/u/Ralph_Zbrog)\
**Post date:** [September 25, 2008, 9:35pm UTC](https://techcommunity.softwareag.com/t/rollback-or-commit-transactions/79110/4 "2008-09-25T21:35:48Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![mqrandi](https://avatars.discourse-cdn.com/v4/letter/m/b3f665/32.png) [@mqrandi](https://techcommunity.softwareag.com/u/mqrandi)\
**Post date:** [May 3, 2009, 8:21am UTC](https://techcommunity.softwareag.com/t/rollback-or-commit-transactions/79110/5 "2009-05-03T08:21:00Z")

</div>

it results in a commit transaction

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/techcommunity/original/3X/c/d/cd19967bb605d28a72d77eb83a1cae22f3df2eb8.svg) [@system](https://techcommunity.softwareag.com/u/system)\
**Post date:** [April 2, 2021, 2:50pm UTC](https://techcommunity.softwareag.com/t/rollback-or-commit-transactions/79110/6 "2021-04-02T14:50:56Z")

</div>


