From aad9961a71a56ec45ccf6bac8536010f584e121a Mon Sep 17 00:00:00 2001 From: wenshao Date: Wed, 7 Dec 2011 11:12:05 +0800 Subject: [PATCH] bug fixed : after real connection closed, closePoolableStatementError --- .../java/com/alibaba/druid/pool/PoolableConnection.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/main/java/com/alibaba/druid/pool/PoolableConnection.java b/src/main/java/com/alibaba/druid/pool/PoolableConnection.java index 6ce6c97072..2920ee6d99 100644 --- a/src/main/java/com/alibaba/druid/pool/PoolableConnection.java +++ b/src/main/java/com/alibaba/druid/pool/PoolableConnection.java @@ -81,6 +81,10 @@ public class PoolableConnection implements PooledConnection, Connection { } void closePoolableStatement(PoolablePreparedStatement stmt) throws SQLException { + if (this.isClosed()) { + return; + } + PreparedStatement rawStatement = stmt.getRawPreparedStatement(); try { @@ -88,6 +92,10 @@ public class PoolableConnection implements PooledConnection, Connection { } catch (SQLException ex) { LOG.error("clear parameter error", ex); } + + if (holder == null) { + return; + } if (holder.isPoolPreparedStatements()) { stmt.clearResultSet();