Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0038828Openbravo ERPA. Platformpublic2018-06-21 11:202018-06-25 18:32
AugustoMauch 
AugustoMauch 
normalmajorhave not tried
closedfixed 
5
 
3.0PR18Q2.13.0PR18Q2.1 
caristu
Core
No
0038828: If flush inside TriggerHandler.enable() throws an exception, threadlocal is not cleared, thread remains with triggers disabled
If flush inside TriggerHandler.enable() throws an exception, threadlocal is not cleared, thread remains with triggers disabled.

This means that when that thread is reused the database and hibernate triggers will be disabled, although still the safety mechanisms work and the disablement will not be committed to the database.
Create a process that:
- Disables the triggers
- Adds a record that will result in an exception when the flush is done (for instance create a UOM with a name of an existing one)
- Reenable the triggers. An exception will be thrown
- Don't disable the triggers again, and place some log to show whether the triggers are disabled. The next time the previous thread executes that log, it will show that their triggers remain disabled.
No tags attached.
blocks defect 0038801 closed AugustoMauch If flush inside TriggerHandler.enable() throws an exception, threadlocal is not cleared, thread remains with triggers disabled 
Issue History
2018-06-25 14:04AugustoMauchTypedefect => backport
2018-06-25 14:04AugustoMauchTarget Version => 3.0PR18Q2.1
2018-06-25 14:52hgbotCheckin
2018-06-25 14:52hgbotNote Added: 0105361
2018-06-25 14:52hgbotStatusscheduled => resolved
2018-06-25 14:52hgbotResolutionopen => fixed
2018-06-25 14:52hgbotFixed in SCM revisionhttp://code.openbravo.com/erp/devel/pi/rev/3392fa97aa1c07f41e2727f8fdfea738c8716359 [^] => http://code.openbravo.com/erp/backports/3.0PR18Q2.1/rev/4887e05c89dc0357d1049a2024210612198d80cb [^]
2018-06-25 18:17hgbotCheckin
2018-06-25 18:17hgbotNote Added: 0105368
2018-06-25 18:32caristuNote Added: 0105370
2018-06-25 18:32caristuStatusresolved => closed
2018-06-25 18:32caristuFixed in Version => 3.0PR18Q2.1

Notes
(0105361)
hgbot   
2018-06-25 14:52   
Repository: erp/backports/3.0PR18Q2.1
Changeset: 4887e05c89dc0357d1049a2024210612198d80cb
Author: Augusto Mauch <augusto.mauch <at> openbravo.com>
Date: Mon Jun 25 14:52:03 2018 +0200
URL: http://code.openbravo.com/erp/backports/3.0PR18Q2.1/rev/4887e05c89dc0357d1049a2024210612198d80cb [^]

Fixes issue 38828: TriggerHandler.enable no longer leaves triggers disabled

The problem was that if the flush indie TriggerHandler.enable (invoked when retrieving DAL's connection) failed, the clear method was not
invoked, and the ThreadLocal was not reset. The next time the thread was reused, it would work with disabled triggers.

Now that doesn't happen anymore because the flush is done inside the try block.

---
M src/org/openbravo/dal/core/TriggerHandler.java
---
(0105368)
hgbot   
2018-06-25 18:17   
Repository: erp/backports/3.0PR18Q2.1
Changeset: 72eebae994003d05cc273025047462d84a085b57
Author: Augusto Mauch <augusto.mauch <at> openbravo.com>
Date: Mon Jun 25 18:16:41 2018 +0200
URL: http://code.openbravo.com/erp/backports/3.0PR18Q2.1/rev/72eebae994003d05cc273025047462d84a085b57 [^]

Related with issue 38828: Fixes log

---
M src/org/openbravo/dal/core/TriggerHandler.java
---
(0105370)
caristu   
2018-06-25 18:32   
Reviewed