Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0035356Openbravo ERPA. Platformpublic2017-02-24 10:292017-03-15 20:20
alostale 
caristu 
normalminorhave not tried
closedfixed 
5
 
3.0PR17Q2 
alostale
Core
Pre packaging ( pi )
2017-01-23
pi
http://code.openbravo.com/erp/devel/pi/rev/84e7958bae798b41046be8e1ed65ab7af1705587 [^]
No
0035356: print & attach doc logs error using (old) commons jdbc pool
When working with the old commons jdbc pool, an error is logged when printing a document if it is is also attached.
1. set up Openbravo.properties to use old setting "db.externalPoolClassName="
2. Select any completed sales invoice
3. Click on print report
4. Select to attach the report once generated
   -> ERROR check logs:
javax.servlet.ServletException: @CODE=@connnection proxy not usable after transaction completion
    at org.openbravo.erpCommon.utility.MessageBDData.message(MessageBDData.java:134)
    at org.openbravo.erpCommon.utility.BasicUtility.messageBD(BasicUtility.java:76)
    at org.openbravo.erpCommon.utility.Utility.messageBD(Utility.java:303)
    at org.openbravo.erpCommon.utility.reporting.ReportManager.processReport(ReportManager.java:104)
    at org.openbravo.erpCommon.utility.reporting.printing.PrintController.post(PrintController.java:256)
    at org.openbravo.erpCommon.utility.reporting.printing.PrintInvoices.doPost(PrintInvoices.java:54)
No tags attached.
related to defect 0035313 closed caristu invoice PDF is not attached from "email" button in sales invoice window 
related to defect 0035193 closed caristu Error fired when trying to print and attach a document 
related to defect 0032576 closed alostale connection leak when printing Requisition report 
related to defect 0023882 closed alostale 2 dangling DB connections after Tomcat start 
related to defect 0027155 closed eduardo_Argal Cannot return the credit to a customer 
caused by feature request 0034816 closed caristu Support a second database for reporting 
related to defect 0036636 closed alostale new DalConnectionProvider() causes double flush in 1 case 
Issue History
2017-02-24 10:29alostaleNew Issue
2017-02-24 10:29alostaleAssigned To => platform
2017-02-24 10:29alostaleModules => Core
2017-02-24 10:29alostaleTriggers an Emergency Pack => No
2017-02-24 10:30alostaleRelationship addedrelated to 0035313
2017-02-24 10:30alostaleStatusnew => acknowledged
2017-02-24 10:34alostaleRelationship addedrelated to 0035193
2017-02-24 15:20caristuRelationship addedcaused by 0034816
2017-02-24 15:21caristuRegression level => Pre packaging ( pi )
2017-02-24 15:21caristuRegression date => 2017-01-23
2017-02-24 15:21caristuRegression introduced in release => pi
2017-02-24 15:21caristuRegression introduced by commit => http://code.openbravo.com/erp/devel/pi/rev/84e7958bae798b41046be8e1ed65ab7af1705587 [^]
2017-02-24 15:21caristuRelationship addedrelated to 0032576
2017-02-24 15:26caristuNote Added: 0094619
2017-02-24 15:26caristuStatusacknowledged => scheduled
2017-02-24 15:26caristuAssigned Toplatform => caristu
2017-02-27 08:42caristuNote Edited: 0094619bug_revision_view_page.php?bugnote_id=0094619#r14680
2017-02-27 09:11caristuRegression levelPre packaging ( pi ) =>
2017-02-27 09:11caristuRegression date2017-01-23 =>
2017-02-27 09:11caristuRegression introduced in releasepi =>
2017-02-27 09:11caristuRegression introduced by commithttp://code.openbravo.com/erp/devel/pi/rev/84e7958bae798b41046be8e1ed65ab7af1705587 [^] =>
2017-02-27 09:35caristuRegression level => Pre packaging ( pi )
2017-02-27 09:35caristuRegression introduced in release => pi
2017-02-27 09:35caristuRegression introduced by commit => http://code.openbravo.com/erp/devel/pi/rev/84e7958bae798b41046be8e1ed65ab7af1705587 [^]
2017-02-27 09:35caristuRegression date => 2017-01-23
2017-02-27 10:22caristuRelationship addedrelated to 0023882
2017-02-27 10:23caristuRelationship addedrelated to 0027155
2017-02-27 10:28caristuNote Edited: 0094619bug_revision_view_page.php?bugnote_id=0094619#r14681
2017-02-27 10:52hgbotCheckin
2017-02-27 10:52hgbotNote Added: 0094630
2017-02-27 10:52hgbotStatusscheduled => resolved
2017-02-27 10:52hgbotResolutionopen => fixed
2017-02-27 10:52hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/1f961fdb2035b67112525fb3dfc9a5fe6535da5a [^]
2017-02-27 10:53caristuReview Assigned To => alostale
2017-02-27 10:53caristuNote Added: 0094631
2017-03-03 09:03alostaleNote Added: 0094713
2017-03-03 09:03alostaleStatusresolved => closed
2017-03-03 09:03alostaleFixed in Version => 3.0PR17Q2
2017-03-15 20:20hudsonbotCheckin
2017-03-15 20:20hudsonbotNote Added: 0095237
2017-08-11 12:45caristuRelationship addedrelated to 0036636

Notes
(0094619)
caristu   
2017-02-24 15:26   
(edited on: 2017-02-27 10:28)
This problem is caused because since feature 0034816 the ReportManager makes use of the DalConnectionProvider to generate reports.

When priting + attach, the transaction is closed at the middle of this process by the fix introduced with issue 0032576, causing this error to be reproduced but just when the external connection pool is not defined.

Note that this was a problem which already existed, but since 0034816 is visible in an easier way.

(0094630)
hgbot   
2017-02-27 10:52   
Repository: erp/devel/pi
Changeset: 1f961fdb2035b67112525fb3dfc9a5fe6535da5a
Author: Carlos Aristu <carlos.aristu <at> openbravo.com>
Date: Mon Feb 27 10:50:16 2017 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/1f961fdb2035b67112525fb3dfc9a5fe6535da5a [^]

fixes bug 35356: print & attach doc logs error using (old) commons jdbc pool

After closing a connection retrieved from the Hibernate pool, it is marked as not usable. It is not possible to check the status of such connections because a HibernateException is thrown.

After printing a report which makes use of the getCountryNumberFormat and applyCountryDateFormat methods of the Utility class, the connection is closed to prevent possible connection leaks. Therefore, when using the Hibernate pool, the connection is marked as not usable causing the HibernateException when checking the status of the connection after printing the report.

To fix the problem now we are handling the HibernateException and initializing the connection properly.

---
M src/org/openbravo/service/db/DalConnectionProvider.java
---
(0094631)
caristu   
2017-02-27 10:53   
Added test into TestLink: https://testlink.openbravo.com/testlink/linkto.php?tprojectPrefix=Communit&item=testcase&id=Communit-10558 [^]
(0094713)
alostale   
2017-03-03 09:03   
code reviewed + tested
(0095237)
hudsonbot   
2017-03-15 20:20   
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/54e102bef53e [^]
Maturity status: Test