Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0033438Openbravo ERPA. Platformpublic2016-07-06 10:062016-08-11 18:40
alostale 
alostale 
urgentmajorsometimes
closedfixed 
5
 
3.0PR16Q4 
caristu
Core
No
0033438: DalConnectionProvider.getTransactionConnection does not obtain connection from common pool
DalConnectionProvider.getTransactionConnection method used to keep transaction in sqlc, obtains the new connection directly from Hibernate's pool regardless how Openbravo pool is configured.

The consequences are:

  • New connection does not get initialized with the session config parameters, this can cause the problem reported in 0033429
  • These new connections are autonomously managed out of the declared pool
Using Oracle, install 3.1.1200 version of the aging balance module: https://code.openbravo.com/erp/mods/org.openbravo.agingbalance [^]

Go to Receivables Aging Balance.
Launch the report with the parameters:
*Organization: F&B España
*General Ledger: F&B España
*As of date: 27-06-2016
*Show Details: Checked
The rest of the parameters can be set with the default values

It should throw an error:
55585 [http-8081-2] ERROR org.openbravo.base.exception.OBException - Error
javax.servlet.ServletException: @CODE=1843@ORA-01843: not a valid month

    at org.openbravo.agingbalance.ad_reports.AgingDaoData.selectDetail(AgingDaoData.java:492)
    at org.openbravo.agingbalance.ad_reports.AgingDao.getOpenReceivablesAgingScheduleDetails(AgingDao.java:217)
    at org.openbravo.agingbalance.ad_reports.AgingProcess.printPageDetails(AgingProcess.java:391)
    at org.openbravo.agingbalance.ad_reports.AgingProcess.doPost(AgingProcess.java:156)
    at org.openbravo.base.HttpBaseServlet.doGet(HttpBaseServlet.java:294)

This behavior is not always consistent.
No tags attached.
related to defect 0033429 closed aferraz Modules Problems in Aging Balance Report with Oracle due to date formats 
related to defect 0027878 closed marvintm Openbravo ERP Code in DalConnectionprovider relate to getTransactionConnection seems to leak db connections always 
related to defect 00334413.0PR16Q4 closed NaroaIriarte Openbravo ERP query to check if ad_context_info exists executed once per request 
related to defect 0033507 closed NaroaIriarte Openbravo ERP copy lines can generate incorrect audit trail info 
related to defect 0038097 closed alostale Openbravo ERP DalConnectionProvider.getTransactionConnection with dbcp pool does not set db config query 
Issue History
2016-07-06 10:06alostaleNew Issue
2016-07-06 10:06alostaleAssigned To => platform
2016-07-06 10:06alostaleModules => Core
2016-07-06 10:06alostaleTriggers an Emergency Pack => No
2016-07-06 10:06alostaleIssue generated from0033429
2016-07-06 10:06alostaleRelationship addedrelated to 0033429
2016-07-06 10:13alostaleSummaryProblems in Aging Balance Report with Oracle due to date formats => DalConnectionProvider.getTransactionConnection does not obtain connection from common pool
2016-07-06 10:13alostaleDescription Updatedbug_revision_view_page.php?rev_id=12616#r12616
2016-07-06 10:13alostaleSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=12618#r12618
2016-07-06 10:13alostaleProposed Solution updated
2016-07-06 10:14alostaleDescription Updatedbug_revision_view_page.php?rev_id=12619#r12619
2016-07-06 10:15alostaleRelationship addedrelated to 0027878
2016-07-06 12:18alostaleRelationship addedrelated to 0033441
2016-07-06 12:18alostaleAssigned Toplatform => alostale
2016-07-06 12:19alostaleStatusnew => scheduled
2016-07-06 13:35hgbotCheckin
2016-07-06 13:35hgbotNote Added: 0088238
2016-07-06 13:59hgbotCheckin
2016-07-06 13:59hgbotNote Added: 0088242
2016-07-06 13:59hgbotStatusscheduled => resolved
2016-07-06 13:59hgbotResolutionopen => fixed
2016-07-06 13:59hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/89ad9b716896f01b574bfbac7f14e7a9775c1450 [^]
2016-07-08 07:54alostaleReview Assigned To => caristu
2016-07-20 12:48alostaleRelationship addedrelated to 0033507
2016-07-22 13:02caristuNote Added: 0088635
2016-07-22 13:02caristuStatusresolved => closed
2016-07-22 13:02caristuFixed in Version => 3.0PR16Q4
2016-08-11 18:40hudsonbotCheckin
2016-08-11 18:40hudsonbotNote Added: 0088992
2018-03-09 15:20alostaleRelationship addedrelated to 0038097

Notes
(0088238)
hgbot   
2016-07-06 13:35   
Repository: erp/mods/org.openbravo.agingbalance
Changeset: eae2aeebcc7e0ed2974264cf62c7e1f891d3c0fc
Author: Víctor Martínez Romanos <victor.martinez <at> openbravo.com>
Date: Wed Jul 06 12:48:00 2016 +0200
URL: http://code.openbravo.com/erp/mods/org.openbravo.agingbalance/rev/eae2aeebcc7e0ed2974264cf62c7e1f891d3c0fc [^]

Fixed bug 33429: Problems in Aging Balance Report with Oracle due to date formats

This is a workaround for issue 33438. We pass the connection provider from the servlet to avoid this random problems on Oracle only

---
M src/org/openbravo/agingbalance/ad_reports/AgingDao.java
M src/org/openbravo/agingbalance/ad_reports/AgingProcess.java
---
(0088242)
hgbot   
2016-07-06 13:59   
Repository: erp/devel/pi
Changeset: 89ad9b716896f01b574bfbac7f14e7a9775c1450
Author: Asier Lostalé <asier.lostale <at> openbravo.com>
Date: Wed Jul 06 10:55:04 2016 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/89ad9b716896f01b574bfbac7f14e7a9775c1450 [^]

fixed bug 33438: DCP.getTransactionConnection doesn't get connection from pool

  DalConnectionProvider.getTransactionConnection obtained connection directly
  from Hibernate's pool rather than from the configured one. This caused that
  connection not to be set with the correct configuration parameters, as well
  as it not to be centrally managed.

  This problem is now fixed by making public the method to obtain a new connection
  from the configured pool in SessionHandler, now DalConnectionProvider invokes
  it to get the connection instead of doing it explicitly.

---
M src/org/openbravo/dal/core/SessionHandler.java
M src/org/openbravo/service/db/DalConnectionProvider.java
---
(0088635)
caristu   
2016-07-22 13:02   
Code review + testing OK

Verified in pi@ea24d6781214
(0088992)
hudsonbot   
2016-08-11 18:40   
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/edaa05b1fb18 [^]
Maturity status: Test