Openbravo Issue Tracking System - Modules
View Issue Details
0058301ModulesExternal Data Integrationpublic2025-03-20 17:502025-03-24 10:19
caristu 
caristu 
highmajorhave not tried
closedfixed 
5
 
 
approved
Gold
0058301: NonUniqueObjectException thrown in EDL non blocking processes under some circumstances
When executing non blocking EDL processes, there is a random failure that may happen at the beginning of the "non blocking" execution:

2025-03-19 15:23:53,653 [NonBlocking - 0] ERROR org.openbravo.externaldata.integration.process.ProcessRequest - Unhandled exception processing request line
org.hibernate.NonUniqueObjectException: A different object with the same identifier value was already associated with the session : [OBEDL_Process#17B50CF4701240868D03BDF047F9B1F3]
    at org.hibernate.engine.internal.StatefulPersistenceContext.checkUniqueness(StatefulPersistenceContext.java:700) ~[hibernate-core-5.6.15.Final.jar:5.6.15.Final]
1) Apply the provided patch which forces an scenario to reproduce the error by not cleaning the SessionHandler in the non-blocking thread
2) Trigger a Push API event
3) Trigger again another Push API event, the error will be thrown
No tags attached.
depends on defect 0058306 closed caristu 25Q1 backport - NonUniqueObjectException thrown in EDL non blocking processes under some circumstances 
depends on defect 0058307 closed caristu 24Q4 backport - NonUniqueObjectException thrown in EDL non blocking processes under some circumstances 
diff reproducer.diff (1,586) 2025-03-20 17:50
https://issues.openbravo.com/file_download.php?file_id=21068&type=bug
Issue History
2025-03-20 17:50caristuNew Issue
2025-03-20 17:50caristuAssigned To => Triage Platform Conn
2025-03-20 17:50caristuFile Added: reproducer.diff
2025-03-20 17:50caristuOBNetwork customer => No
2025-03-20 18:01hgbotMerge Request Status => open
2025-03-20 18:01hgbotNote Added: 0177036
2025-03-21 10:09alostaleOBNetwork customerNo => Gold
2025-03-21 10:09alostaleSeverityminor => major
2025-03-21 10:10alostaleStatusnew => scheduled
2025-03-21 10:10alostaleAssigned ToTriage Platform Conn => caristu
2025-03-21 10:11alostaleIssue cloned0058306
2025-03-21 10:11alostaleRelationship addeddepends on 0058306
2025-03-21 10:11alostaleIssue cloned0058307
2025-03-21 10:11alostaleRelationship addeddepends on 0058307
2025-03-21 10:13hgbotMerge Request Statusopen => approved
2025-03-21 10:13hgbotNote Added: 0177104
2025-03-21 10:13hgbotResolutionopen => fixed
2025-03-21 10:13hgbotStatusscheduled => closed
2025-03-21 10:13hgbotNote Added: 0177105
2025-03-21 12:49hgbotNote Added: 0177111
2025-03-24 08:27hgbotNote Added: 0177151
2025-03-24 10:19hgbotNote Added: 0177161
2025-03-24 10:19hgbotNote Added: 0177162

Notes
(0177036)
hgbot   
2025-03-20 18:01   
Merge Request created: https://gitlab.com/orisha-group/bu-commerce/openbravo/product/pmods/org.openbravo.externaldata.integration/-/merge_requests/48 [^]
(0177104)
hgbot   
2025-03-21 10:13   
Merge request merged: https://gitlab.com/orisha-group/bu-commerce/openbravo/product/pmods/org.openbravo.externaldata.integration/-/merge_requests/48 [^]
(0177105)
hgbot   
2025-03-21 10:13   
Directly closing issue as related merge request is already approved.

Repository: https://gitlab.com/orisha-group/bu-commerce/openbravo/product/pmods/org.openbravo.externaldata.integration [^]
Changeset: 0699530cf09ca78bf9ed832b293376d83d12720d
Author: Carlos Aristu <c.aristu@orisha.com>
Date: 21-03-2025 10:13:24
URL: https://gitlab.com/orisha-group/bu-commerce/openbravo/product/pmods/org.openbravo.externaldata.integration/-/commit/0699530cf09ca78bf9ed832b293376d83d12720d [^]

fixes ISSUE-58301: SessionHandler is leaked in non-blocking threads

  A NonUniqueObjectException exception was being thrown sometimes when
the line and its linked objects are re-attached into the session of the
non-blocking thread in the nonBlockingEDLCompleted method.

  Although we have not been able to find a real scenario to force the
problem yet, this error indicates that non-blocking threads may be
leaking the SessionHandler thread local.

  So, to try to avoid this problem, now when we start the execution of
the non blocking part we close the SessionHandler to ensure that we
continue with a fresh new session, instead of using a leaked one.

---
M src/org/openbravo/externaldata/integration/process/AsynchronousProcessor.java
M src/org/openbravo/externaldata/integration/process/ItemProcessor.java
M src/org/openbravo/externaldata/integration/process/ProcessRequest.java
---
(0177111)
hgbot   
2025-03-21 12:49   
Repository: https://gitlab.com/orisha-group/bu-commerce/openbravo/product/pmods/org.openbravo.externaldata.integration [^]
Changeset: bee25894e6b3b8486cc4b32588e172b064aa877f
Author: Carlos Aristu <c.aristu@orisha.com>
Date: 21-03-2025 12:49:38
URL: https://gitlab.com/orisha-group/bu-commerce/openbravo/product/pmods/org.openbravo.externaldata.integration/-/commit/bee25894e6b3b8486cc4b32588e172b064aa877f [^]

related to ISSUE-58301: fix test

---
M src-test/org/openbravo/externaldata/integration/process/AsynchronousProcessorTest.java
---
(0177151)
hgbot   
2025-03-24 08:27   
Merge Request created: https://gitlab.com/orisha-group/bu-commerce/openbravo/product/pmods/org.openbravo.externaldata.integration/-/merge_requests/49 [^]
(0177161)
hgbot   
2025-03-24 10:19   
Repository: https://gitlab.com/orisha-group/bu-commerce/openbravo/product/pmods/org.openbravo.externaldata.integration [^]
Changeset: 49582b207dba9167068b1bc414d90090491a677d
Author: Carlos Aristu <c.aristu@orisha.com>
Date: 24-03-2025 07:27:55
URL: https://gitlab.com/orisha-group/bu-commerce/openbravo/product/pmods/org.openbravo.externaldata.integration/-/commit/49582b207dba9167068b1bc414d90090491a677d [^]

related to ISSUE-58301: add comment clarifying lock purpose + extract method

---
M src/org/openbravo/externaldata/integration/process/ProcessRequest.java
---
(0177162)
hgbot   
2025-03-24 10:19   
Merge request merged: https://gitlab.com/orisha-group/bu-commerce/openbravo/product/pmods/org.openbravo.externaldata.integration/-/merge_requests/49 [^]