Anonymous | Login
Project:
RSS
  
News | My View | View Issues | Roadmap | Summary

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0038801
TypeCategorySeverityReproducibilityDate SubmittedLast Update
defect[Openbravo ERP] A. Platformmajorhave not tried2018-06-21 11:202018-06-26 13:47
ReporterAugustoMauchView Statuspublic 
Assigned ToAugustoMauch 
PrioritynormalResolutionfixedFixed in Version
StatusclosedFix in branchFixed in SCM revision3392fa97aa1c
ProjectionnoneETAnoneTarget Version
OSAnyDatabaseAnyJava version
OS VersionDatabase versionAnt version
Product VersionSCM revision 
Review Assigned Tocaristu
Web browser
ModulesCore
Regression level
Regression date
Regression introduced in release
Regression introduced by commit
Triggers an Emergency PackNo
Summary

0038801: If flush inside TriggerHandler.enable() throws an exception, threadlocal is not cleared, thread remains with triggers disabled

DescriptionIf 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.
Steps To ReproduceCreate 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.
TagsNo tags attached.
Attached Files

- Relationships Relation Graph ] Dependency Graph ]
depends on backport 00388283.0PR18Q2.1 closedAugustoMauch If flush inside TriggerHandler.enable() throws an exception, threadlocal is not cleared, thread remains with triggers disabled 

-  Notes
(0105316)
hgbot (developer)
2018-06-21 17:58

Repository: erp/devel/pi
Changeset: 28cc0cfb94b45de99ab260781cec14a00e8ae25e
Author: Augusto Mauch <augusto.mauch <at> openbravo.com>
Date: Thu Jun 21 17:57:27 2018 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/28cc0cfb94b45de99ab260781cec14a00e8ae25e [^]

Fixes bug 38801: Error in TriggerHandler.enable doesnt leave 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
---
(0105322)
hgbot (developer)
2018-06-21 18:49

Repository: erp/devel/pi
Changeset: 5756317d93ad48446f1d70fd0f21750b4b6240ce
Author: Gorka Gil <gorka.gil <at> openbravo.com>
Date: Thu Jun 21 18:48:23 2018 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/5756317d93ad48446f1d70fd0f21750b4b6240ce [^]

Related to issue 38801: Backed out changeset 28cc0cfb94b4 - breaks the install.source

---
M src/org/openbravo/dal/core/TriggerHandler.java
---
(0105335)
hgbot (developer)
2018-06-22 12:35

Repository: erp/devel/pi
Changeset: 3392fa97aa1c07f41e2727f8fdfea738c8716359
Author: Augusto Mauch <augusto.mauch <at> openbravo.com>
Date: Fri Jun 22 10:27:58 2018 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/3392fa97aa1c07f41e2727f8fdfea738c8716359 [^]

Fixes bug 38801: Error in TriggerHandler.enable doesnt leave triggers disabled

The original fix was not proper, because the DAL connection was being retrieved inside a
try-with-resources block, so it was being automatically closed.

---
M src/org/openbravo/dal/core/TriggerHandler.java
---
(0105336)
hudsonbot (developer)
2018-06-22 12:39

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/31731ad72b18 [^]
Maturity status: Test
(0105337)
hudsonbot (developer)
2018-06-22 12:40

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/31731ad72b18 [^]
Maturity status: Test
(0105341)
caristu (developer)
2018-06-22 13:07

Code reviewed.
(0105360)
AugustoMauch (developer)
2018-06-25 14:04

Reopened to create backport
(0105452)
hudsonbot (developer)
2018-06-26 13:47

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/0f403f60ff29 [^]
Maturity status: Test

- Issue History
Date Modified Username Field Change
2018-06-21 11:20 AugustoMauch New Issue
2018-06-21 11:20 AugustoMauch Assigned To => AugustoMauch
2018-06-21 11:20 AugustoMauch Modules => Core
2018-06-21 11:20 AugustoMauch Triggers an Emergency Pack => No
2018-06-21 11:45 maite Issue Monitored: networkb
2018-06-21 17:58 hgbot Checkin
2018-06-21 17:58 hgbot Note Added: 0105316
2018-06-21 17:58 hgbot Status new => resolved
2018-06-21 17:58 hgbot Resolution open => fixed
2018-06-21 17:58 hgbot Fixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/28cc0cfb94b45de99ab260781cec14a00e8ae25e [^]
2018-06-21 18:00 AugustoMauch Review Assigned To => caristu
2018-06-21 18:49 hgbot Checkin
2018-06-21 18:49 hgbot Note Added: 0105322
2018-06-22 12:35 hgbot Checkin
2018-06-22 12:35 hgbot Note Added: 0105335
2018-06-22 12:35 hgbot Fixed in SCM revision http://code.openbravo.com/erp/devel/pi/rev/28cc0cfb94b45de99ab260781cec14a00e8ae25e [^] => http://code.openbravo.com/erp/devel/pi/rev/3392fa97aa1c07f41e2727f8fdfea738c8716359 [^]
2018-06-22 12:39 hudsonbot Checkin
2018-06-22 12:39 hudsonbot Note Added: 0105336
2018-06-22 12:40 hudsonbot Checkin
2018-06-22 12:40 hudsonbot Note Added: 0105337
2018-06-22 13:07 caristu Note Added: 0105341
2018-06-22 13:07 caristu Status resolved => closed
2018-06-22 13:07 caristu Fixed in Version => 3.0PR18Q3
2018-06-25 14:04 AugustoMauch Note Added: 0105360
2018-06-25 14:04 AugustoMauch Status closed => new
2018-06-25 14:04 AugustoMauch Resolution fixed => open
2018-06-25 14:04 AugustoMauch Fixed in Version 3.0PR18Q3 =>
2018-06-25 14:04 AugustoMauch Status new => scheduled
2018-06-25 14:04 AugustoMauch Status scheduled => resolved
2018-06-25 14:04 AugustoMauch Resolution open => fixed
2018-06-25 14:04 AugustoMauch Status resolved => closed
2018-06-26 13:47 hudsonbot Checkin
2018-06-26 13:47 hudsonbot Note Added: 0105452


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker