bug fixed for pscache, if preparedStatement throw exception, removed from pscache. issue #1052

This commit is contained in:
wenshao
2016-11-24 00:30:11 +08:00
parent b0c791e007
commit 94638ad16f
2 changed files with 6 additions and 4 deletions
@@ -164,7 +164,7 @@ public class DruidPooledConnection extends PoolableWrapper implements javax.sql.
}
stmt.getPreparedStatementHolder().decrementInUseCount();
if (stmt.isPooled() && holder.isPoolPreparedStatements()) {
if (stmt.isPooled() && holder.isPoolPreparedStatements() && stmt.exceptionCount == 0) {
holder.getStatementPool().put(stmt.getPreparedStatementHolder());
stmt.clearResultSet();