Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0011568Openbravo ERPA. Platformpublic2009-12-01 11:452009-12-11 06:38
mtaal 
mtaal 
normalminoralways
closedfixed 
5
pi 
pi 
Core
No
0011568: Heartbeat uses multiple database connections and closes connection too early
The src/org/openbravo/erpCommon/ad_process/TestHeartbeat.java class uses multiple db connections to read information from the database and commits a transaction to read the data again in the next step in a new connection.

The early commit results in errors in hibernate because an object is not linked to a session anymore.


gr. Martin

The solution is to use DalConnectionProvider and use one connection for all steps.
No tags attached.
Issue History
2009-12-01 11:45mtaalNew Issue
2009-12-01 11:45mtaalAssigned To => mtaal
2009-12-01 11:45mtaalStatusnew => scheduled
2009-12-01 11:45mtaalfix_in_branch => pi
2009-12-01 11:46mtaalNote Added: 0022289
2009-12-01 11:46mtaalStatusscheduled => resolved
2009-12-01 11:46mtaalFixed in Version => pi
2009-12-01 11:46mtaalFixed in SCM revision => 5502
2009-12-01 11:46mtaalResolutionopen => fixed
2009-12-08 14:04mtaalNote Added: 0022544
2009-12-08 14:04mtaalStatusresolved => new
2009-12-08 14:04mtaalResolutionfixed => open
2009-12-08 14:04mtaalFixed in Versionpi =>
2009-12-08 16:44hgbotCheckin
2009-12-08 16:44hgbotNote Added: 0022547
2009-12-08 16:44hgbotStatusnew => resolved
2009-12-08 16:44hgbotResolutionopen => fixed
2009-12-08 16:44hgbotFixed in SCM revision5502 => http://code.openbravo.com/erp/devel/pi/rev/c021f8b29557b4cdf74747fa53b978e6e8791cf4 [^]
2009-12-09 11:36iperdomoNote Added: 0022571
2009-12-09 11:36iperdomoStatusresolved => new
2009-12-09 11:36iperdomoResolutionfixed => open
2009-12-10 11:17hgbotCheckin
2009-12-10 11:17hgbotNote Added: 0022611
2009-12-10 11:17hgbotStatusnew => resolved
2009-12-10 11:17hgbotResolutionopen => fixed
2009-12-10 11:17hgbotFixed in SCM revisionhttp://code.openbravo.com/erp/devel/pi/rev/c021f8b29557b4cdf74747fa53b978e6e8791cf4 [^] => http://code.openbravo.com/erp/devel/pi/rev/50f57c84e40910857a5f0ed21bc6419765e3621f [^]
2009-12-10 18:49iperdomoNote Added: 0022661
2009-12-10 18:49iperdomoStatusresolved => closed
2009-12-11 00:00anonymoussf_bug_id0 => 2912319
2009-12-11 06:35hudsonbotCheckin
2009-12-11 06:35hudsonbotNote Added: 0022674
2009-12-11 06:38hudsonbotCheckin
2009-12-11 06:38hudsonbotNote Added: 0022681

Notes
(0022289)
mtaal   
2009-12-01 11:46   
Changeset:

https://code.openbravo.com/erp/devel/pi/rev/641e8014bc50 [^]
(0022544)
mtaal   
2009-12-08 14:04   
One more change is needed for this issue.

When a new ProcessRequest is created then the OBScheduler is called. However, the OBScheduler uses its own connection provider. If the transaction is not committed before the scheduler is called. Then the OBScheduler won't see the ProcessRequest if it is new.

So before calling the OBScheduler a commit has to be done.
(0022547)
hgbot   
2009-12-08 16:44   
Repository: erp/devel/pi
Changeset: c021f8b29557b4cdf74747fa53b978e6e8791cf4
Author: Martin Taal <martin.taal <at> openbravo.com>
Date: Tue Dec 08 16:43:55 2009 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/c021f8b29557b4cdf74747fa53b978e6e8791cf4 [^]

fixes issue 11568: Heartbeat uses multiple database connections and closes connection too early

---
M src/org/openbravo/erpCommon/ad_process/TestHeartbeat.java
---
(0022571)
iperdomo   
2009-12-09 11:36   
I tested on pi @ rev785d51b8023e and got a wrong message and this errors in the log:

a3196480 978929 [http-8880-6] ERROR org.openbravo.erpCommon.utility.MessageBDData - Exception in query: SELECT MSGTEXT FROM AD_MESSAGE WHERE VALUE=?Exception:org.hibernate.HibernateException: connnection proxy not usable after transaction completion
a3196480 978929 [http-8880-6] ERROR org.openbravo.erpCommon.utility.MessageBDData - Exception in query: SELECT NAME FROM AD_ELEMENT WHERE COLUMNNAME=?Exception:org.hibernate.HibernateException: connnection proxy not usable after transaction completion
(0022611)
hgbot   
2009-12-10 11:17   
Repository: erp/devel/pi
Changeset: 50f57c84e40910857a5f0ed21bc6419765e3621f
Author: Martin Taal <martin.taal <at> openbravo.com>
Date: Thu Dec 10 11:16:59 2009 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/50f57c84e40910857a5f0ed21bc6419765e3621f [^]

fixes issue 11568: Heartbeat uses multiple database connections and closes connection too early

---
M src/org/openbravo/erpCommon/ad_process/TestHeartbeat.java
---
(0022661)
iperdomo   
2009-12-10 18:49   
Tested on pi @ rev e82d1b5b692e
(0022674)
hudsonbot   
2009-12-11 06:35   
---
A changeset related to this issue has passed a series of tests and has been promoted to main:

Changeset: http://code.openbravo.com/erp/devel/main/rev/789f4e19eaf7 [^]
Tests: http://builds.openbravo.com/view/devel-int/ [^]
---
(0022681)
hudsonbot   
2009-12-11 06:38   
---
An OBX is generated including a changeset related to this issue and is available at:

OBX: http://builds.openbravo.com/erp/obx/core/OpenbravoERP-2.50CI.15682.obx [^]
---