mirror of
https://github.com/apache/struts.git
synced 2026-08-06 15:17:00 +00:00
A proper way to close the db connection
Conflicts: plugins/jasperreports/src/main/java/org/apache/struts2/views/jasperreports/JasperReportsResult.java
This commit is contained in:
committed by
Lukasz Lenart
parent
1158b0adda
commit
bf46145baf
+7
-1
@@ -65,7 +65,7 @@ import java.util.TimeZone;
|
||||
* format is specified.
|
||||
* <p/>
|
||||
* <!-- END SNIPPET: description -->
|
||||
* <p />
|
||||
* <p>
|
||||
* <b>This result type takes the following parameters:</b>
|
||||
* <p/>
|
||||
* <!-- START SNIPPET: params -->
|
||||
@@ -397,6 +397,12 @@ public class JasperReportsResult extends StrutsResultSupport implements JasperRe
|
||||
String message = "Error producing " + format + " report for uri " + systemId;
|
||||
LOG.error(message, e);
|
||||
throw new ServletException(e.getMessage(), e);
|
||||
} finally {
|
||||
try {
|
||||
conn.close();
|
||||
} catch (Exception e) {
|
||||
LOG.warn("Could not close db connection properly", e);
|
||||
}
|
||||
}
|
||||
|
||||
response.setContentLength(output.length);
|
||||
|
||||
Reference in New Issue
Block a user