Skip to content

Commit

Permalink
A proper way to close the db connection
Browse files Browse the repository at this point in the history
Conflicts:
	plugins/jasperreports/src/main/java/org/apache/struts2/views/jasperreports/JasperReportsResult.java
  • Loading branch information
victorsosa authored and lukaszlenart committed Jan 4, 2016
1 parent 1158b0a commit bf46145
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
* format is specified.
* <p/>
* <!-- END SNIPPET: description -->
* <p />
* <p>
* <b>This result type takes the following parameters:</b>
* <p/>
* <!-- START SNIPPET: params -->
Expand Down Expand Up @@ -397,6 +397,12 @@ protected void doExecute(String finalLocation, ActionInvocation invocation) thro
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);
Expand Down

0 comments on commit bf46145

Please sign in to comment.