# Natural Transaction is holding DB2 Table

**URL:** <https://techcommunity.softwareag.com/t/natural-transaction-is-holding-db2-table/170698>\
**Category:** Forum\
**Tags:** Adabas-Natural, Natural, Natural-on-Mainframes\
**Created:** [April 15, 2013, 1:21pm UTC](https://techcommunity.softwareag.com/t/natural-transaction-is-holding-db2-table/170698 "2013-04-15T13:21:56Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nitin1](https://avatars.discourse-cdn.com/v4/letter/n/dc4da7/32.png) [@Nitin1](https://techcommunity.softwareag.com/u/Nitin1)\
**Post date:** [April 15, 2013, 1:21pm UTC](https://techcommunity.softwareag.com/t/natural-transaction-is-holding-db2-table/170698/1 "2013-04-15T13:21:56Z")

</div>

Hi,

I am getting issue when performing DELETION of records from DB2 Table while calling from Online Natural Program . There is no index on DB2 table. It is working fine in TEST region but gettting issues while executing in Production. I read manual that  
in TEST SQL run in dynamic mode whereas in production it is static.

- 
- Delete the records from the table TBPOPP28
- 

SELECT REC\_CNT  
INTO VIEW TBPOPP28  
FROM TBPOPP28  
DELETE FROM TBPOPP28  
END-SELECT  
END TRANSACTION  
\*

When I check in Table Editor to check the updates, getting following message as table is on hold be DELETE statement. Can one help me why it is happening so.

ETI801E Pgm: ETI@PREP Stmt: 00462 Type: FETCH

DSNT408I SQLCODE = -911, ERROR: THE CURRENT UNIT OF WORK HAS BEEN ROLLED BACK  
DUE TO DEADLOCK OR TIMEOUT. REASON 00C9008E, TYPE OF RESOURCE  
00000D01, AND RESOURCE NAME 00000356.00000235

---

<div class="post-metadata">

**Author:** ![Neuler\_Coelho](https://avatars.discourse-cdn.com/v4/letter/n/f475e1/32.png) [@Neuler\_Coelho](https://techcommunity.softwareag.com/u/Neuler_Coelho)\
**Post date:** [April 25, 2013, 2:13am UTC](https://techcommunity.softwareag.com/t/natural-transaction-is-holding-db2-table/170698/2 "2013-04-25T02:13:12Z")

</div>

When you make a SELECT without clause where, all the records has selected in the memory of the DB2.

So, when the DB2 try make a instruction DELETE, the records has in use (hold in the clausule SELECT) and has the error.

Try make the DELETE instruction after close the SELECT (after the END-SELECT).

"  
SELECT REC\_CNT  
INTO VIEW TBPOPP28  
FROM TBPOPP28  
END-SELECT  
DELETE FROM TBPOPP28  
END TRANSACTION  
"

But, caution because this instrutions deleting all the records of table TBPOPP28. Are you sure this?

---

<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, 3:28pm UTC](https://techcommunity.softwareag.com/t/natural-transaction-is-holding-db2-table/170698/3 "2021-04-02T15:28:38Z")

</div>


