diff options
author | Jonatan Kronqvist <jonatan.kronqvist@itmill.com> | 2011-09-22 08:49:46 +0000 |
---|---|---|
committer | Jonatan Kronqvist <jonatan.kronqvist@itmill.com> | 2011-09-22 08:49:46 +0000 |
commit | 02dbee6888c87286e41784adf80d95d676178841 (patch) | |
tree | da8e5f3b526a2ef44d42e53afba7e795d9831594 /src/com/vaadin/data | |
parent | a35f91dee5f28b1832b461ba5b98d1f3e6468d35 (diff) | |
download | vaadin-framework-02dbee6888c87286e41784adf80d95d676178841.tar.gz vaadin-framework-02dbee6888c87286e41784adf80d95d676178841.zip |
Fixed npe in SQLContainer's J2EEConnectionPool #7597
svn changeset:21225/svn branch:6.7
Diffstat (limited to 'src/com/vaadin/data')
-rw-r--r-- | src/com/vaadin/data/util/sqlcontainer/connection/J2EEConnectionPool.java | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/com/vaadin/data/util/sqlcontainer/connection/J2EEConnectionPool.java b/src/com/vaadin/data/util/sqlcontainer/connection/J2EEConnectionPool.java index 09c9cc1b1b..12a2c6cd9f 100644 --- a/src/com/vaadin/data/util/sqlcontainer/connection/J2EEConnectionPool.java +++ b/src/com/vaadin/data/util/sqlcontainer/connection/J2EEConnectionPool.java @@ -5,12 +5,16 @@ package com.vaadin.data.util.sqlcontainer.connection; import java.sql.Connection; import java.sql.SQLException; +import java.util.logging.Level; +import java.util.logging.Logger; import javax.naming.InitialContext; import javax.naming.NamingException; import javax.sql.DataSource; public class J2EEConnectionPool implements JDBCConnectionPool { + private static final Logger logger = Logger + .getLogger(J2EEConnectionPool.class.getName()); private String dataSourceJndiName; @@ -50,10 +54,12 @@ public class J2EEConnectionPool implements JDBCConnectionPool { } public void releaseConnection(Connection conn) { - try { - conn.close(); - } catch (SQLException e) { - e.printStackTrace(); + if (conn != null) { + try { + conn.close(); + } catch (SQLException e) { + logger.log(Level.FINE, "Could not release SQL connection", e); + } } } |