[ https://issues.apache.org/jira/browse/WW-3462?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15080404#comment-15080404
]
ASF GitHub Bot commented on WW-3462:
------------------------------------
GitHub user victorsosa opened a pull request:
https://github.com/apache/struts/pull/64
Patch WW-3462 connection open after report generation
Now the connection is close after been used.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/victorsosa/struts master
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/struts/pull/64.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #64
----
commit 316b8a926e7bec85c83f69b2460a8b7d938d1686
Author: Victor Sosa <victornsosa@gmail.com>
Date: 2016-01-03T11:34:00Z
Patch WW-3462
connection open after report generation
Now the connection is close after been used.
commit 38da3f67051bc557312adb234424becf533c5f95
Author: Victor Sosa <victornsosa@gmail.com>
Date: 2016-01-03T11:36:34Z
Merge branch 'master' of git@github.com:victorsosa/struts.git
----
> connection open after report generation
> ---------------------------------------
>
> Key: WW-3462
> URL: https://issues.apache.org/jira/browse/WW-3462
> Project: Struts 2
> Issue Type: Bug
> Components: Plugin - JasperReports
> Affects Versions: 2.1.8
> Environment: jdk1.5.0_16
> Reporter: Salva
> Fix For: 3.0
>
> Original Estimate: 20m
> Remaining Estimate: 20m
>
> If a report generation was called with connection like following code, database connection
will not be closed. I suggest to modify doExecute method of org.apache.struts2.views.jasperreports.JasperReportsResult
class after the exportReportToBytes, by adding, in case of conn not null, the conn closing.
> struts.xml
> ...
> <action name="report" class="myorg.actions.tests.Report">
> <result name="success" type="jasper">
> <param name="location">/test/Report.jasper</param>
> <param name="connection">myConnection</param>
> <param name="contentDisposition">attachment</param>
> <param name="format">PDF</param>
> </result>
> </action>
> ....
> Action execute method code
> ...
> DataSource ds = (DataSource) ictx.lookup("java:jdbc/myApp");
> myConnection = ds.getConnection();
> ...
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
|