Merge pull request #4425 from cutesnail/master

回收PreparedStatement时,不仅clearParameters,还要clearBatch,因为Query对象的batchedArgs里的批量数据需要清除
This commit is contained in:
温绍锦
2021-09-20 13:40:28 +08:00
committed by GitHub
@@ -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();