improve unpooled statement's performance

This commit is contained in:
wenshao
2013-06-08 14:01:52 +08:00
parent 1f45ea28ee
commit 2a48c90450
5 changed files with 68 additions and 36 deletions
@@ -145,7 +145,7 @@ public class DruidPooledConnection extends PoolableWrapper implements javax.sql.
return;
}
if (holder.isPoolPreparedStatements()) {
if (stmt.isPooled()) {
try {
rawStatement.clearParameters();
} catch (SQLException ex) {
@@ -159,7 +159,7 @@ public class DruidPooledConnection extends PoolableWrapper implements javax.sql.
}
stmt.getPreparedStatementHolder().decrementInUseCount();
if (holder.isPoolPreparedStatements()) {
if (stmt.isPooled() && holder.isPoolPreparedStatements()) {
holder.getStatementPool().put(stmt.getPreparedStatementHolder());
stmt.clearResultSet();