Deadlock in EnterpriseOne

Purpose of Document

Through this case study, an actual implementation is discussed to minimize potential deadlocks in EnterpriseOne Distribution, Manufacturing and Financial Modules. Below are two common tables that can be used to isolate certain transactions:

Note: Custom Table Triggers and/or Stored Procedures and Functions cause deadlocks. Ensure that any external program does not affect daily transactions. Refer to <Document 1301427.1> E1: DB: Custom Stored Procedure Causes Deadlock in the Database

Table of Contents:

Listing of Applications with Transaction Processing by EnterpriseOne Release

Refer to Listing of Applications with Transaction Processing in EnterpriseOne

Note: Deadlocks occur in applications listed above

Back To Top


Example 1: In Sales Order

(An example of a deadlock scenario in the Distribution Module)In updating Sales Order, the order gets held and held orders are released before the transaction is committed.

No Deadlock Scenario:

Transaction 1: through P42101-Sales Order Entry
1. ENTER: SalesOrderApplCtrlEX 2. ENTER: F4211FSEndDoc 3. ENTER: WriteHoldCode sql> UPDATE PRODDTA.F4209 SET (...) WHERE (order number 9999) 3. EXIT: for WriteHoldCode=0 2. EXIT: for F4211FSEndDoc=0 1. EXIT: for SalesOrderApplCtrlEX=0
Transaction 2: through P43070-Held Order Release
1. ENTER: ReleaseHeldOrder sql> UPDATE PRODDTA.F4209 SET (...) WHERE (order number 9999)1. EXIT: for ReleaseHeldOrder=0

Deadlock Scenario:

Transaction 1: through P42101-Sales Order Entry
1. ENTER: SalesOrderApplCtrlEX 2. ENTER: F4211FSEndDoc 3. ENTER: WriteHoldCode sql> UPDATE PRODDTA.F4209 SET (...) WHERE (order number 9999) 3. EXIT: for WriteHoldCode=0
Transaction 2: through P43070-Held Order Release
1. ENTER: ReleaseHeldOrder sql> UPDATE PRODDTA.F4209 SET (...) WHERE (order number 9999) *** Deadlock takes place ***1. EXIT: for ReleaseHeldOrder=0 ... 2. EXIT: for F4211FSEndDoc=01. EXIT: for SalesOrderApplCtrlEX=0

SOLUTION

This type of issue may occur when 'Transaction Processing' is on/enabled. To prevent this type of issue, 'Record Reservation' logic can be implemented. For details on Record Reservation, refer to <Document 625589.1> E1: 40: User Record Reservation.

  1. Fast path to UDC
  2. Look for Product Code: 00 (Foundation Environment) and User Defined Codes 'RR' - Object In Use Application ID
  3. Ensure application ID P42101 and P43070 are added

Notes:

Back To Top


Example 2: In Bill of Material

(An example of a deadlock scenario in the Manufacturing Module)In adding/updating BOM (Bill of Material) through P3002, deadlocks may take place against table F4102 as two processes (Internal Routines) are competing to updating the same table within EndDoc routine- F3002EndDocument. This example shows how a deadlock occurs within one transaction in a single application.

No Deadlock Scenario:

Turn off Transaction Processing so AUTO COMMIT takes place

Deadlock Scenario:

Transaction 1: through P3002-Bill of Material
1. ENTER: F3002EndDocument 2. ENTER: UpdateLowLevelCodes sql> UPDATE PRODDTA.F4102 SET ... IBLLX=7 WHERE (IBITM = 999 AND IBMCU =' M30') 2. EXIT: for UpdateLowLevelCodes=0 2. ENTER: UpdateF4102MRPNetChg sql> UPDATE PRODDTA.F4102 SET ... IBMRPC='1' WHERE (IBITM = 999 AND IBMCU = ' M30') *** Deadlock takes place *** 2. EXIT: for UpdateF4102MRPNetChg=0 sql> **** Other Insert/Update against F3002 ***1. EXIT: for F3002EndDocument=0

Notes:

SOLUTION

Apply relevant ESUs which contain objects or disable Transaction Processing through Form Design Aid Back To Top

Example 3: In Voucher Entry

(An example of a deadlock scenario in the Financial Module)In adding invoice, voucher or journal, two different transactions in a single application may cause deadlocks when updating F0011 - Batch Header.

No Deadlock Scenario:

Transaction 1:
1. ENTER: F0411FSEndDoc 2. ENTER: BatchReviseOnTransactionCommit sql> UPDATE PRODDTA.F0011 SET ...,ICIST='U',ICIAPP='P',... WHERE ( ICICUT = 'V' AND ICICU = 9999 ) 2. EXIT: for BatchReviseOnTransactionCommit=0 *** Additional manipulation of data *** 1. EXIT: for F0411FSEndDoc=0
Transaction 2:
1. ENTER: BatchReviseOnExit sql> UPDATE PRODDTA.F0011 SET ...,ICIST='A',ICIAPP='A',... WHERE ( ICICUT = 'V' AND ICICU = 9999 ) 1. EXIT: for BatchReviseOnExit=0

Deadlock Scenario:

Transaction 1:
1. ENTER: F0411FSEndDoc 2. ENTER: BatchReviseOnTransactionCommit sql> UPDATE PRODDTA.F0011 SET ...,ICIST='U',ICIAPP='P',... WHERE ( ICICUT = 'V' AND ICICU = 9999 ) 2. EXIT: for BatchReviseOnTransactionCommit=0
Transaction 2:
1. ENTER: BatchReviseOnExit sql> UPDATE PRODDTA.F0011 SET ...,ICIST='A',ICIAPP='A',... WHERE ( ICICUT = 'V' AND ICICU = 9999 ) *** Deadlock takes place ***1. EXIT: for BatchReviseOnExit=01. EXIT: for F0411FSEndDoc=0

SOLUTION

If both transactions are called when 'Transaction Processing' is enabled, then call both BSFNs (xxxEndDoc and BatchReviseOnExit) asynchronously.Alternatively, implement batch creation. Alternatively, call the first BSFN synchronously. (A drawback of this configuration is that users have to wait until the first transaction is fully committed). See the following table which illustrates this further:

1st BSFN Call: F0411FSEndDoc 2nd BSFN Call: BatchReviseOnExit Result
Transaction Processing (On/Off) Async Transaction Processing (On/Off) Async
Ref #1> On Yes On Yes OK
Ref #2> On Yes On No Not OK
Ref #3> On No On/Off Yes/No OK
Ref #4> Off No On/Off Yes/No OK

Notes:

Back To Top


Example 4: Example in Transaction which impact more than 2 modules

Refer to <Note 1050946.1> E1: 34: F4102.IBMRPC - NetChangeFlag (Flag - Net Change) FAQ

When encountering deadlocks:

Deadlock Scenario:

Transaction 1

1. ShipConfirmEndDoc 2. F4211GetShipmentInfo 3. F4311OrderIntegrity 4. F4311EditLine 4. F4311EndDoc 5. SetNetChangeFlag SELECT IBITM, IBMCU, IBMRPC, IBUSER, IBPID, IBJOBN, IBUPMJ, IBTDAY FROM CRPDTA.F4102 WHERE ( IBITM = 1234.000000 AND IBMCU = ' M30' ) 6. GetAuditInfo 6. EXIT: for GetAuditInfo=0 UPDATE CRPDTA.F4102 SET IBITM=1234.000000,IBMCU=' M30',IBMRPC='1',IBUSER='JDE',IBPID='EP4310',IBJOBN='LOCAL',IBUPMJ=112341,IBTDAY=185546.000000 WHERE ( IBITM = 1234.000000 AND IBMCU = ' M30' )... 2. F4312EndDoc 3. F0911FSEndDoc 3. F4111EndDocument 3. F4311EndDoc 3. UpdateF4102MRPNetChg SELECT IBITM, IBMCU, IBVEND, IBMRPC, IBUSER, IBPID, IBJOBN, IBUPMJ, IBTDAY FROM CRPDTA.F4102 WHERE ( IBITM = 1234.000000 AND ' M30' ) UPDATE CRPDTA.F4102 SET IBITM=1234.000000,IBMCU=' M30',IBVEND=4343.000000,IBMRPC='1',IBUSER='JDE',IBPID='EP4205',IBJOBN='LOCAL',IBUPMJ=112341,IBTDAY=185551.000000 WHERE ( IBITM = 1234.000000 AND IBMCU = ' M30' ) OCI0000178 - Unable to execute - UPDATE CRPDTA.F4102 SET IBITM=:BND1,IBMCU=:BND2,IBVEND=:BND3,IBMRPC=:BND4,IBUSER=:BND5,IBPID=:BND6,IBJOBN=:BND7,IBUPMJ=:BND8,IBTDAY=:BND9 WHERE ( IBITM = :KEY1 AND IBMCU = :KEY2 )...

SOLUTION:

In case you face any deadlock (Transaction Failure) for routines explained above, do apply <BUG 11007632> - ETO DEADLOCK BY PO RECEIPT - SAR: 8925493 which sets update of F4102.mrpc for B4000930 - UpdateF4102MRPNetChg (F4102 Updata MRP Net Change) and <Bug 13490757>: DATABASE RECORD LOCK UPDATING NET CHANGE FLAG MRPC ON PURCHASE ORDER AND PARTSLIST for B3100170 - SetNetChangeFlag (Set Net Change Flag) at outside Transaction Processing boundaries through below code:

idJDBReturn = JDB_InitUser((HENV) lpBhvrCom->hEnv, &hUser, (JCHAR *)NULL, JDEDB_COMMIT_AUTO);

Note:

Back To Top


Conclusion

In general, deadlocks will impact daily business significantly. When encountering deadlocks:

Back To Top

Note: