Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0033750Openbravo ERPA. Platformpublic2016-08-19 12:162016-09-02 13:39
gorkaion 
gorkaion 
normalminoralways
closedfixed 
5
 
3.0PR16Q4 
alostale
Core
No
0033750: Add API in SessionHandler to create new Transactions on active Session
When implementing a TransactionCompleted event the Transaction on the active Session is not active. This means that it is not possible to do database changes in those event handlers.

It should be possible to begin a new transaction when needed. Currently this is only possible by deleting the session which can create issues in processes that do commitAndStart().
* Create an event handler that implements the TransactionCompleted event.

Case 1:
* Try to do an insert or an update on some entity on the event handler.
* It fails with a Transaction not active error.
Case 2:
* Do a SessionHandler.deleteSession() at the beginning of the TransactionCompleted event implementation.
* The event handler does not fail but the Physical Inventory Count process fails. (it does a commitAndStart() which fires the event handler which deletes the session)


Create a new public method in SessionHandler that begins a new transaction in the current active Session.
No tags attached.
blocks design defect 0033210pi closed gorkaion VariantChDescUpdateProcess executed using ImportEntries instead of ProcessBundle 
patch issue33750.patch (803) 2016-08-19 12:19
https://issues.openbravo.com/file_download.php?file_id=9734&type=bug
Issue History
2016-08-19 12:16gorkaionNew Issue
2016-08-19 12:16gorkaionAssigned To => gorkaion
2016-08-19 12:16gorkaionModules => Core
2016-08-19 12:16gorkaionTriggers an Emergency Pack => No
2016-08-19 12:19gorkaionRelationship addedrelated to 0033210
2016-08-19 12:19gorkaionFile Added: issue33750.patch
2016-08-19 12:30gorkaionRelationship deletedrelated to 0033210
2016-08-19 12:30gorkaionRelationship addedblocks 0033210
2016-08-31 11:21gorkaionReview Assigned To => alostale
2016-08-31 11:44hgbotCheckin
2016-08-31 11:44hgbotNote Added: 0089595
2016-08-31 11:44hgbotStatusnew => resolved
2016-08-31 11:44hgbotResolutionopen => fixed
2016-08-31 11:44hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/4ece62a0e09c265e63eaa42b9c73acbef98c8996 [^]
2016-08-31 12:23hgbotCheckin
2016-08-31 12:23hgbotNote Added: 0089596
2016-08-31 12:23hgbotFixed in SCM revisionhttp://code.openbravo.com/erp/devel/pi/rev/4ece62a0e09c265e63eaa42b9c73acbef98c8996 [^] => http://code.openbravo.com/erp/devel/pi/rev/2255a10488676a72f7b311ef7ea433f59dc19fab [^]
2016-09-01 12:12hudsonbotCheckin
2016-09-01 12:12hudsonbotNote Added: 0089650
2016-09-01 12:12hudsonbotCheckin
2016-09-01 12:12hudsonbotNote Added: 0089651
2016-09-02 13:39alostaleNote Added: 0089703
2016-09-02 13:39alostaleStatusresolved => closed
2016-09-02 13:39alostaleFixed in Version => 3.0PR16Q4

Notes
(0089595)
hgbot   
2016-08-31 11:44   
Repository: erp/devel/pi
Changeset: 4ece62a0e09c265e63eaa42b9c73acbef98c8996
Author: Gorka Ion Damián <gorkaion.damian <at> openbravo.com>
Date: Wed Aug 31 11:42:06 2016 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/4ece62a0e09c265e63eaa42b9c73acbef98c8996 [^]

Fixed issue 33750.Add new methods in SessionHandler to manage transactions.

Two new public methods added:
- isCurrentTransactionActive()
- beginNewTransaction()

These methods are needed to be able to modify the database in EventHandlers
that are fired when the transaction is completed.

---
M src-db/database/sourcedata/AD_MESSAGE.xml
M src/org/openbravo/dal/core/SessionHandler.java
---
(0089596)
hgbot   
2016-08-31 12:23   
Repository: erp/devel/pi
Changeset: 2255a10488676a72f7b311ef7ea433f59dc19fab
Author: Gorka Ion Damián <gorkaion.damian <at> openbravo.com>
Date: Wed Aug 31 12:22:30 2016 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/2255a10488676a72f7b311ef7ea433f59dc19fab [^]

Fixed issue 33750.Add new methods in SessionHandler to manage transactions.

Two new public methods added:
- isCurrentTransactionActive()
- beginNewTransaction()

These methods are needed to be able to modify the database in EventHandlers
that are fired when the transaction is completed.

---
M src/org/openbravo/dal/core/SessionHandler.java
---
(0089650)
hudsonbot   
2016-09-01 12:12   
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/a321ec570edd [^]
Maturity status: Test
(0089651)
hudsonbot   
2016-09-01 12:12   
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/a321ec570edd [^]
Maturity status: Test
(0089703)
alostale   
2016-09-02 13:39   
code reviewed