Openbravo Issue Tracking System - Retail Modules
View Issue Details
0030174Retail ModulesWeb POSpublic2015-06-13 13:302015-06-29 09:36
mtaal 
mtaal 
normalcriticalhave not tried
closedfixed 
5
 
RR15Q3RR15Q3 
marvintm
No
0030174: Triggers temporarily disabled for whole application through webpos
When running webpos in a high load environment it shows that sometimes triggers are enabled in the middle of the cashup backend code, causing the code to fail (see attached stack trace for an example).

What causes this is that the triggers disabled record in AD_SESSION_STATUS gets committed and is visible for other connections, these connections/threads also enable triggers after their work, effectively deleting the AD_SESSION_STATUS record, this again results in the original thread having triggers enabled during processing.

Exact flow:
Thread 1: does cashup by first disabling triggers and creating AD_SESSION_STATUS record, this record should only be visible to thread 1 as the insert should not be committed. But it is...
Thread 1: calls ordergrouping processor which does commit, now everyone sees the new AD_SESSION_STATUS record
Thread 2: was already doing work, disabling triggers in his own connection, and then enabling them again, this removes all AD_SESSION_STATUS records visible to the connection of thread 2, this now also includes the AD_SESSION_STATUS record created for thread 1, so AD_SESSION_STATUS for thread 1 also gets deleted.
Thread 1: tries to do its remaining work but gets an error because triggers are suddenly enabled again because thread 2 deleted it AD_SESSION_STATUS record.


Caused by this change:
https://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/4685#l1.361 [^]
Run stress test simulate business day with 2 nodes and 5 clients each. One run will result in several errors in OBPOS import errors
Replace this line:
https://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/4685#l1.361 [^]

with OBDal.getInstance().flush()

Also add a check to the SessionHandler commit code to not allow commits when triggers are enabled.
No tags attached.
caused by defect 0029774RR15Q3 closed malsasua Retail Modules [cashup refactor] improve the performance of cashup 
related to design defect 0029611 acknowledged Triage Platform Base Openbravo ERP The way we disable triggers with TriggerHandler may lead to leaving the triggers disabled indefinitly 
txt stack.txt (7,454) 2015-06-13 13:30
https://issues.openbravo.com/file_download.php?file_id=8203&type=bug
diff check_triggers_disabled.diff (1,075) 2015-06-13 13:31
https://issues.openbravo.com/file_download.php?file_id=8204&type=bug
Issue History
2015-06-13 13:30mtaalNew Issue
2015-06-13 13:30mtaalAssigned To => mtaal
2015-06-13 13:30mtaalFile Added: stack.txt
2015-06-13 13:30mtaalTriggers an Emergency Pack => No
2015-06-13 13:31mtaalFile Added: check_triggers_disabled.diff
2015-06-13 17:10hgbotCheckin
2015-06-13 17:10hgbotNote Added: 0078264
2015-06-13 17:10hgbotStatusnew => resolved
2015-06-13 17:10hgbotResolutionopen => fixed
2015-06-13 17:10hgbotFixed in SCM revision => http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/276b29d81030bb2fa50fabf08ee4470a51d8bc17 [^]
2015-06-15 08:26alostaleRelationship addedcaused by 0029774
2015-06-15 10:44hgbotCheckin
2015-06-15 10:44hgbotNote Added: 0078289
2015-06-16 00:37hudsonbotCheckin
2015-06-16 00:37hudsonbotNote Added: 0078309
2015-06-29 09:36marvintmReview Assigned To => marvintm
2015-06-29 09:36marvintmStatusresolved => closed
2015-06-29 09:36marvintmFixed in Version => RR15Q3
2016-01-26 09:56AugustoMauchRelationship addedrelated to 0029611

Notes
(0078264)
hgbot   
2015-06-13 17:10   
Repository: erp/pmods/org.openbravo.retail.posterminal
Changeset: 276b29d81030bb2fa50fabf08ee4470a51d8bc17
Author: Martin Taal <martin.taal <at> openbravo.com>
Date: Sat Jun 13 13:42:17 2015 +0200
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/276b29d81030bb2fa50fabf08ee4470a51d8bc17 [^]

Fixes issue 30174: Triggers temporarily disabled for whole application through webpos
Replace commit and close with flush

---
M src/org/openbravo/retail/posterminal/OrderGroupingProcessor.java
---
(0078289)
hgbot   
2015-06-15 10:44   
Repository: erp/devel/pi
Changeset: 98cb1ce1537dadf935205bb3b84f4457d7da7d29
Author: Martin Taal <martin.taal <at> openbravo.com>
Date: Mon Jun 15 08:45:40 2015 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/98cb1ce1537dadf935205bb3b84f4457d7da7d29 [^]

Related to issue 30174: Triggers temporarily disabled for whole application through webpos
Added check/test code in OBDal to prevent disabling triggers 'globally'

---
M src/org/openbravo/dal/core/SessionHandler.java
---
(0078309)
hudsonbot   
2015-06-16 00:37   
A changeset related to this issue has been promoted main and to the
Central Repository, after passing a series of tests.

Promotion changeset: https://code.openbravo.com/erp/devel/main/rev/fa5bbdf39822 [^]
Maturity status: Test