Openbravo Issue Tracking System - Openbravo ERP | |||||
View Issue Details | |||||
ID | Project | Category | View Status | Date Submitted | Last Update |
0033909 | Openbravo ERP | A. Platform | public | 2016-09-06 12:21 | 2016-09-26 09:31 |
Reporter | gorkaion | ||||
Assigned To | gorkaion | ||||
Priority | normal | Severity | major | Reproducibility | always |
Status | closed | Resolution | fixed | ||
Platform | OS | 5 | OS Version | ||
Product Version | |||||
Target Version | pi | Fixed in Version | 3.0PR16Q4 | ||
Merge Request Status | |||||
Review Assigned To | alostale | ||||
OBNetwork customer | No | ||||
Web browser | |||||
Modules | Core | ||||
Support ticket | |||||
Regression level | |||||
Regression date | |||||
Regression introduced in release | |||||
Regression introduced by commit | |||||
Triggers an Emergency Pack | No | ||||
Summary | 0033909: NPE exception if a commitAndClose() is executed in a onTransactionComplete handler | ||||
Description | Consider a EventHandler that fires on the TransactionCompleted event and that performs a commitAndClose() in its code. If the event handler is fired by another commitAndClose() a NPE is thrown on the second commitAndClose execution. This is happens as both executions are on the same SessionHandler instance. The first one does "setSession(null)" so when the second one executes the "closeSession()" a NPE is thrown because the "session" object is null. | ||||
Steps To Reproduce | Update pi to cd08dd7274e3 revision. 1 Go to product characteristics window. 2 Create a new characteristic and a new value. 3 On the new value click on AddProducts and select a couple of products. 4 Press done and the process fails with a NPE. The reason of the NPE is: 1 DalThreadHandler executes the commitAndClose() when the add product process finishes. 2 this fires the ProductCharacteristicValueEventHandler which executes "importEntryManager.createImportEntry()" 3. the createImportEntry does another commitAndClose() on the same SessionHandler instance whichs sets to null the session 4. the first commitAndClose() continues the execution and when doint the closeSession() the session is already null and fails. | ||||
Proposed Solution | Add a null check in the SessionHandler.closeSession() method: protected void closeSession() { if (session != null && session.isOpen()) { session.close(); } } | ||||
Additional Information | |||||
Tags | No tags attached. | ||||
Relationships | |||||
Attached Files | |||||
Issue History | |||||
Date Modified | Username | Field | Change | ||
2016-09-06 12:21 | gorkaion | New Issue | |||
2016-09-06 12:21 | gorkaion | Assigned To | => gorkaion | ||
2016-09-06 12:21 | gorkaion | OBNetwork customer | => No | ||
2016-09-06 12:21 | gorkaion | Modules | => Core | ||
2016-09-06 12:21 | gorkaion | Triggers an Emergency Pack | => No | ||
2016-09-07 09:52 | hgbot | Checkin | |||
2016-09-07 09:52 | hgbot | Note Added: 0089797 | |||
2016-09-07 09:52 | hgbot | Status | new => resolved | ||
2016-09-07 09:52 | hgbot | Resolution | open => fixed | ||
2016-09-07 09:52 | hgbot | Fixed in SCM revision | => http://code.openbravo.com/erp/devel/pi/rev/e46e66b4f2191ff0a1ca2e4c4ac1818dc2353532 [^] | ||
2016-09-07 19:58 | hudsonbot | Checkin | |||
2016-09-07 19:58 | hudsonbot | Note Added: 0089813 | |||
2016-09-15 09:37 | gorkaion | Review Assigned To | => alostale | ||
2016-09-26 09:31 | alostale | Status | resolved => closed | ||
2016-09-26 09:31 | alostale | Fixed in Version | => 3.0PR16Q4 |
Notes | |||||
|
|||||
|
|
||||
|
|||||
|
|