Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0030891Openbravo ERPA. Platformpublic2015-09-22 17:272015-11-23 21:16
ioritzCia 
alostale 
urgentmajoralways
closedfixed 
30Ubuntu 14.04
 
3.0PR16Q13.0PR16Q1 
caristu
Google Chrome
Core
No
0030891: Xsql files parser does not release statement for callable statements
The parser that generates a xxxxxData.java from a xxxxx_data.xsql file does not release the statement for Callable Statements.

This is making WebPOS not work properly in Oracle with high volume of transactions as it opens cursors very fast and it does not close them.

Important: This issue reported previously that the java generated did not close the connection. This happens in getStock method but it is not due to a bug. But a bad use of the method definition in the xsql.

Having connection="true" in the xsql definition of a method tells the parser that the connection will be handled by the developer later and not automatically closed by the xxxxxData.java file generated.
Go to StockUtilData.java file.
See select method:
  It is a Prepared Statement.
  Releases the statement in the finally -> connectionProvider.releasePreparedStatement(st);

See getStock method:
  It is a Callable Statement.
  It does not release the statement.
The parser should write the code to release the statement.
Performance
related to defect 0031366 closed alostale 2 tests failing in try-ret-checks-oracle 
Issue History
2015-09-22 17:27ioritzCiaNew Issue
2015-09-22 17:27ioritzCiaAssigned To => platform
2015-09-22 17:27ioritzCiaWeb browser => Google Chrome
2015-09-22 17:27ioritzCiaModules => Core
2015-09-22 17:27ioritzCiaTriggers an Emergency Pack => No
2015-09-22 17:49ioritzCiaWeb browserGoogle Chrome => Google Chrome
2015-09-22 17:49ioritzCiaTarget Version => 3.0PR15Q4
2015-09-23 10:04alostaleStatusnew => acknowledged
2015-09-23 10:04alostaleTag Attached: Performance
2015-09-24 10:40ioritzCiaWeb browserGoogle Chrome => Google Chrome
2015-09-24 10:40ioritzCiaSummaryXsql files parser does not close connection and release statement for callable statements => Xsql files parser does not release statement for callable statements
2015-09-24 10:40ioritzCiaDescription Updatedbug_revision_view_page.php?rev_id=9466#r9466
2015-09-24 10:40ioritzCiaSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=9468#r9468
2015-09-24 10:40ioritzCiaProposed Solution updated
2015-09-29 12:29alostaleTarget Version3.0PR15Q4 => 3.0PR16Q1
2015-10-29 17:16egoitzWeb browserGoogle Chrome => Google Chrome
2015-10-29 17:16egoitzResolution time => 1446678000
2015-10-29 17:18egoitzIssue Monitored: egoitz
2015-10-30 07:50alostaleAssigned Toplatform => alostale
2015-10-30 07:50alostaleStatusacknowledged => scheduled
2015-11-02 13:38hgbotCheckin
2015-11-02 13:38hgbotNote Added: 0081438
2015-11-02 13:38hgbotStatusscheduled => resolved
2015-11-02 13:38hgbotResolutionopen => fixed
2015-11-02 13:38hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/4eceadac7f74a09ffa771900c4f3a5a1403d97e8 [^]
2015-11-02 13:38alostaleReview Assigned To => caristu
2015-11-02 13:38alostaleWeb browserGoogle Chrome => Google Chrome
2015-11-02 13:38alostaleStatusresolved => scheduled
2015-11-02 13:38alostaleResolutionfixed => open
2015-11-02 13:38alostaleFixed in SCM revisionhttp://code.openbravo.com/erp/devel/pi/rev/4eceadac7f74a09ffa771900c4f3a5a1403d97e8 [^] =>
2015-11-02 13:38hgbotCheckin
2015-11-02 13:38hgbotNote Added: 0081439
2015-11-02 13:39hgbotCheckin
2015-11-02 13:39hgbotNote Added: 0081440
2015-11-02 13:39hgbotCheckin
2015-11-02 13:39hgbotNote Added: 0081441
2015-11-02 13:39alostaleStatusscheduled => resolved
2015-11-02 13:39alostaleFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/4eceadac7f74a09ffa771900c4f3a5a1403d97e8 [^]
2015-11-02 13:39alostaleResolutionopen => fixed
2015-11-04 09:08caristuNote Added: 0081463
2015-11-04 09:08caristuStatusresolved => closed
2015-11-04 09:08caristuFixed in Version => 3.0PR16Q1
2015-11-05 10:08alostaleRelationship addedrelated to 0031366
2015-11-23 21:16hudsonbotCheckin
2015-11-23 21:16hudsonbotNote Added: 0082166
2015-11-23 21:16hudsonbotCheckin
2015-11-23 21:16hudsonbotNote Added: 0082167
2015-11-23 21:16hudsonbotCheckin
2015-11-23 21:16hudsonbotNote Added: 0082168
2015-11-23 21:16hudsonbotCheckin
2015-11-23 21:16hudsonbotNote Added: 0082169

Notes
(0081438)
hgbot   
2015-11-02 13:38   
Repository: erp/devel/pi
Changeset: 4eceadac7f74a09ffa771900c4f3a5a1403d97e8
Author: Asier Lostalé <asier.lostale <at> openbravo.com>
Date: Fri Oct 30 11:22:17 2015 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/4eceadac7f74a09ffa771900c4f3a5a1403d97e8 [^]

fixed bug 30891: sqlc transactional callable statemts not released in Oracle

  Working with Oracle transactional callable statements are not closed after
  invokation, causing the number of open cursors to increase unnecessarily.

  There was already code in sqlc to release the statement, but there was an
  extra incorrect check not to do it in case of callable when in transactional
  mode.

  This check has been removed, being now transactional and non transactional cases
  handled in the same way.

---
M src-core/src/org/openbravo/data/Sqlc.java
---
(0081439)
hgbot   
2015-11-02 13:38   
Repository: erp/devel/pi
Changeset: bf8fd604e551b5a9721840bc445689d6a0940db7
Author: Asier Lostalé <asier.lostale <at> openbravo.com>
Date: Fri Oct 30 11:41:50 2015 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/bf8fd604e551b5a9721840bc445689d6a0940db7 [^]

related to bug 30891: added test case

---
M src-test/src/org/openbravo/test/AntTaskTests.java
A src-test/src/org/openbravo/test/db/model/functions/SqlCallableStatement.java
---
(0081440)
hgbot   
2015-11-02 13:39   
Repository: erp/devel/pi
Changeset: bf568b95d85e184b68145146eaf79b1f512daed3
Author: Asier Lostalé <asier.lostale <at> openbravo.com>
Date: Fri Oct 30 12:03:10 2015 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/bf568b95d85e184b68145146eaf79b1f512daed3 [^]

related to bug 30891: added test case

---
M src-test/src/org/openbravo/test/AllAntTaskTests.java
---
(0081441)
hgbot   
2015-11-02 13:39   
Repository: erp/devel/pi
Changeset: 6af281d22ea03936ef47935fd8830726dfe86d36
Author: Asier Lostalé <asier.lostale <at> openbravo.com>
Date: Mon Nov 02 08:33:06 2015 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/6af281d22ea03936ef47935fd8830726dfe86d36 [^]

related to bug 30891: query open cursors as DBA

---
M src-test/src/org/openbravo/test/db/model/functions/SqlCallableStatement.java
---
(0081463)
caristu   
2015-11-04 09:08   
Code review + Tested OK

Now when setting connection="false" or not defining this parameter on transactional callable statements, the release statement (connectionProvider.releasePreparedStatement(st)) is included in the generated file.
(0082166)
hudsonbot   
2015-11-23 21:16   
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/7b56bebaaa88 [^]
Maturity status: Test
(0082167)
hudsonbot   
2015-11-23 21:16   
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/7b56bebaaa88 [^]
Maturity status: Test
(0082168)
hudsonbot   
2015-11-23 21:16   
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/7b56bebaaa88 [^]
Maturity status: Test
(0082169)
hudsonbot   
2015-11-23 21:16   
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/7b56bebaaa88 [^]
Maturity status: Test