Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0036697Openbravo ERPA. Platformpublic2017-08-23 08:412017-09-21 16:49
egoitz 
caristu 
urgentmajorhave not tried
closedfixed 
5
 
3.0PR17Q4 
alostale
Core
No
0036697: connection leak when printing a image on a jasper subreport using the Utility.showImage method
If you create a report that prints an image on the subreport using the method
 org.openbravo.erpCommon.utility.Utility.showImage($F{ad_image_id})
the connections is not closed. It is kept with 'idle in transaction' status.
1-Create a report prininting an image on the subreport using the
 org.openbravo.erpCommon.utility.Utility.showImage($F{ad_image_id}) method.

 1a- Apply the attached patch (subreportImage.diff), which adds an image in the subreport of the "Print Requisition" report.

 1b- Recompile and restart tomcat.

2- In DB (PG) execute: select * from pg_stat_activity where state = 'idle in transaction'
  -> Check there are no rows

3- Execute the report
  
  3a - Go to the [Requisition] window. Create a new record in the header.
  
  3b- Move to the [Lines] tab and create one record at least.

  3c- Generate the report by clicking on the print record of the toolbar.

4- Execute again select * from pg_stat_activity where state = 'idle in transaction'
  -> Check there is one row

Performance
related to defect 0032576 closed alostale connection leak when printing Requisition report 
related to design defect 0030182 closed Triage Platform Base jasper subreports using DAL do leak connection + transactions 
related to defect 0039194 closed caristu Improve parameter name in Utility.getImage(String, boolean) method 
related to defect 0039261 closed jarmendariz connection leak when printing image on subreports using the Utility.showImageLogo method 
related to defect 0048465 closed caristu Some process definition reports stop working after upgrading from 18Q3 to 21Q2.3 
diff subreportImage.diff (40,214) 2017-08-23 12:16
https://issues.openbravo.com/file_download.php?file_id=10999&type=bug
diff issue36697.diff (1,438) 2017-08-23 12:52
https://issues.openbravo.com/file_download.php?file_id=11000&type=bug
diff issue36697v2.diff (2,645) 2017-08-23 13:20
https://issues.openbravo.com/file_download.php?file_id=11001&type=bug
Issue History
2017-08-23 08:41egoitzNew Issue
2017-08-23 08:41egoitzAssigned To => platform
2017-08-23 08:41egoitzModules => Core
2017-08-23 08:41egoitzResolution time => 1505253600
2017-08-23 08:41egoitzTriggers an Emergency Pack => No
2017-08-23 08:41egoitzIssue generated from0032576
2017-08-23 08:41egoitzRelationship addedrelated to 0032576
2017-08-23 10:35caristuRelationship addedrelated to 0030182
2017-08-23 12:09caristuAssigned Toplatform => caristu
2017-08-23 12:16caristuSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=15679#r15679
2017-08-23 12:16caristuFile Added: subreportImage.diff
2017-08-23 12:43caristuStatusnew => scheduled
2017-08-23 12:52caristuFile Added: issue36697.diff
2017-08-23 12:52caristuSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=15680#r15680
2017-08-23 13:20caristuFile Added: issue36697v2.diff
2017-08-23 14:04caristuTag Attached: Performance
2017-08-24 11:24caristuSummaryconnection leak when printing a image on a jasper subreport => connection leak when printing a image on a jasper subreport with showImage method
2017-08-24 11:24caristuSummaryconnection leak when printing a image on a jasper subreport with showImage method => connection leak when printing a image on a jasper subreport using the Utility.showImage method
2017-08-24 12:14hgbotCheckin
2017-08-24 12:14hgbotNote Added: 0098629
2017-08-24 12:14hgbotStatusscheduled => resolved
2017-08-24 12:14hgbotResolutionopen => fixed
2017-08-24 12:14hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/80ab9332dfc520dde252b67de567b0aaae00007a [^]
2017-08-24 12:15caristuReview Assigned To => alostale
2017-08-29 08:00alostaleNote Added: 0098674
2017-08-29 08:00alostaleStatusresolved => closed
2017-08-29 08:00alostaleFixed in Version => 3.0PR17Q4
2017-09-21 16:49hudsonbotCheckin
2017-09-21 16:49hudsonbotNote Added: 0099324
2018-08-28 14:16caristuRelationship addedrelated to 0039194
2018-09-11 09:44JONHMRelationship addedrelated to 0039261
2022-02-02 12:56caristuRelationship addedrelated to 0048465

Notes
(0098629)
hgbot   
2017-08-24 12:14   
Repository: erp/devel/pi
Changeset: 80ab9332dfc520dde252b67de567b0aaae00007a
Author: Carlos Aristu <carlos.aristu <at> openbravo.com>
Date: Thu Aug 24 12:12:26 2017 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/80ab9332dfc520dde252b67de567b0aaae00007a [^]

fixes issue 36697: connection leak when using Utility.showImage in a subreport

 Ensure that the showImage method, which is part of the API used by the reports to retrieve an image from the database, closes the DAL transaction after using it so that the connection is returned back to the pool. Thus, we avoid connection leaks when it is used in a subreport.

---
M src/org/openbravo/erpCommon/utility/Utility.java
---
(0098674)
alostale   
2017-08-29 08:00   
reviewed + tested
(0099324)
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