struts-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lukaszlen...@apache.org
Subject [01/50] [abbrv] struts git commit: A proper way to close the db connection
Date Fri, 15 Jul 2016 13:18:28 GMT
Repository: struts
Updated Branches:
  refs/heads/master cdbf697ad -> 70fdc00f6


A proper way to close the db connection


Project: http://git-wip-us.apache.org/repos/asf/struts/repo
Commit: http://git-wip-us.apache.org/repos/asf/struts/commit/cee303a4
Tree: http://git-wip-us.apache.org/repos/asf/struts/tree/cee303a4
Diff: http://git-wip-us.apache.org/repos/asf/struts/diff/cee303a4

Branch: refs/heads/master
Commit: cee303a4c449f66cb3245de4cfe3915e220b8549
Parents: 9420789
Author: Victor Sosa <victornsosa@gmail.com>
Authored: Sun Jan 3 08:05:03 2016 -0400
Committer: Lukasz Lenart <lukasz.lenart@gmail.com>
Committed: Tue Jan 19 16:17:09 2016 +0100

----------------------------------------------------------------------
 .../struts2/views/jasperreports/JasperReportsResult.java       | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/struts/blob/cee303a4/plugins/jasperreports/src/main/java/org/apache/struts2/views/jasperreports/JasperReportsResult.java
----------------------------------------------------------------------
diff --git a/plugins/jasperreports/src/main/java/org/apache/struts2/views/jasperreports/JasperReportsResult.java
b/plugins/jasperreports/src/main/java/org/apache/struts2/views/jasperreports/JasperReportsResult.java
index 921a010..e0ea121 100644
--- a/plugins/jasperreports/src/main/java/org/apache/struts2/views/jasperreports/JasperReportsResult.java
+++ b/plugins/jasperreports/src/main/java/org/apache/struts2/views/jasperreports/JasperReportsResult.java
@@ -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());


Mime
View raw message