回收PreparedStatement时,不仅clearParameters,还要clearBatch,因为Query对象的batchedArgs里的批量数据需要清除

This commit is contained in:
cutesnail
2021-08-19 11:24:00 +08:00
committed by zhoubin
parent 056645ef88
commit a4dfdda517
@@ -167,6 +167,17 @@ public class DruidPooledConnection extends PoolableWrapper implements javax.sql.
LOG.error("clear parameter error", ex);
}
try {
rawStatement.clearBatch();
} catch (SQLException ex) {
this.handleException(ex, null);
if (rawStatement.getConnection().isClosed()) {
return;
}
LOG.error("clear batch error", ex);
}
}
PreparedStatementHolder stmtHolder = stmt.getPreparedStatementHolder();