A proper way to close the db connection

This commit is contained in:
Victor Sosa
2016-01-03 08:05:03 -04:00
parent 38da3f6705
commit 0e111125d5
@@ -386,7 +386,11 @@ public class JasperReportsResult extends StrutsResultSupport implements JasperRe
LOG.error("Error producing {} report for uri {}", format, systemId, e);
throw new ServletException(e.getMessage(), e);
} finally {
conn.close();
try {
conn.close();
} catch (Exception e) {
LOG.warn("Could not close db connection properly", e);
}
}
response.setContentLength(output.size());