struts-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Salva (JIRA)" <>
Subject [jira] Created: (WW-3462) connection open after report generation
Date Wed, 30 Jun 2010 13:08:53 GMT
connection open after report generation

                 Key: WW-3462
             Project: Struts 2
          Issue Type: Bug
          Components: Plugin - JasperReports
    Affects Versions: 2.1.8
         Environment: jdk1.5.0_16 
            Reporter: Salva

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.

<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>

Action execute method code
DataSource ds = (DataSource) ictx.lookup("java:jdbc/myApp");
myConnection = ds.getConnection();

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message