Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0036636Openbravo ERPA. Platformpublic2017-08-10 16:122017-09-21 16:49
shuehner 
alostale 
normalminorhave not tried
closedfixed 
5
 
3.0PR17Q4 
caristu
Core
No
0036636: new DalConnectionProvider() causes double flush in 1 case
Using that constructor or DalConnectionProvider(true) requests a flush being done.

However at least in 1 case 2 flushes are done instead.

Trigger is:
conn = new DalConnectionProvider()
and then use
connection = conn.getConnection()

which inside the DalConnectionProvider inside the getConnection() method does not have connection member initialized (first use):
      if (connection == null || connection.isClosed()) {
        connection = OBDal.getInstance(pool).getConnection(flush);
      }

but then a few lines later also calls this:
    // always flush all remaining actions
    if (flush) {
      OBDal.getInstance(pool).flush();
    }

Which does 2 flushes in practice when only 1 single one is requested.
calling this java method reproduces the problem
SystemInfo.getSystemIdentifier()

That happen i.e. in the StaticResources request calling it during ftl template processing.
Performance
related to design defect 0036638 new Triage Platform Base DalConnectionProvider(true) or () in combination with standard xsql causes 1 flush per SQL 
related to defect 0035193 closed caristu Error fired when trying to print and attach a document 
related to defect 0035356 closed caristu print & attach doc logs error using (old) commons jdbc pool 
related to defect 0036607 acknowledged Triage Platform Base 4 flushes of 10ms each in StaticResources request 
related to design defect 0036606 new Triage Platform Base Clean up extra not requires flush() calls 
Issue History
2017-08-10 16:12shuehnerNew Issue
2017-08-10 16:12shuehnerAssigned To => platform
2017-08-10 16:12shuehnerModules => Core
2017-08-10 16:12shuehnerTriggers an Emergency Pack => No
2017-08-10 16:13shuehnerRelationship addedrelated to 0036607
2017-08-10 16:13shuehnerRelationship addedrelated to 0036606
2017-08-10 17:16shuehnerRelationship addedrelated to 0036638
2017-08-11 11:49alostaleTag Attached: Performance
2017-08-11 12:18hgbotCheckin
2017-08-11 12:18hgbotNote Added: 0098487
2017-08-11 12:18hgbotStatusnew => resolved
2017-08-11 12:18hgbotResolutionopen => fixed
2017-08-11 12:18hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/64c98f878ddb9f4f0e82905509d191d95fd06764 [^]
2017-08-11 12:18alostaleAssigned Toplatform => alostale
2017-08-11 12:19alostaleReview Assigned To => caristu
2017-08-11 12:45caristuRelationship addedrelated to 0035193
2017-08-11 12:45caristuRelationship addedrelated to 0035356
2017-08-11 13:08caristuNote Added: 0098491
2017-08-11 13:08caristuStatusresolved => closed
2017-08-11 13:08caristuFixed in Version => 3.0PR17Q4
2017-09-21 16:49hudsonbotCheckin
2017-09-21 16:49hudsonbotNote Added: 0099308

Notes
(0098487)
hgbot   
2017-08-11 12:18   
Repository: erp/devel/pi
Changeset: 64c98f878ddb9f4f0e82905509d191d95fd06764
Author: Asier Lostalé <asier.lostale <at> openbravo.com>
Date: Fri Aug 11 11:59:39 2017 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/64c98f878ddb9f4f0e82905509d191d95fd06764 [^]

fixed bug 36636: double flush using DalConnectionProvider(true) if con==null

  When trying to get connection from DalConnectionProvider having set flush=true,
  extra flush is performed in case there's no connection or it's already closed.

  As flush is performed later, this case should alway retrieve connection preventing
  flush.

---
M src/org/openbravo/service/db/DalConnectionProvider.java
---
(0098491)
caristu   
2017-08-11 13:08   
Code reviewed + tested OK.
(0099308)
hudsonbot   
2017-09-21 16:49   
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/9750b78d3e5c [^]
Maturity status: Test