mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
Merge remote-tracking branch 'upstream/master'
This commit is contained in:
@@ -177,6 +177,12 @@ public class DruidPooledConnection extends PoolableWrapper implements javax.sql.
|
||||
stmt.getPreparedStatementHolder().setFetchRowPeak(stmt.getFetchRowPeak());
|
||||
|
||||
stmt.setClosed(true); // soft set close
|
||||
} else if (stmt.isPooled() && holder.isPoolPreparedStatements()) {
|
||||
// the PreparedStatement threw an exception
|
||||
stmt.clearResultSet();
|
||||
holder.removeTrace(stmt);
|
||||
|
||||
holder.getStatementPool().remove(stmt.getPreparedStatementHolder());
|
||||
} else {
|
||||
try {
|
||||
//Connection behind the statement may be in invalid state, which will throw a SQLException.
|
||||
|
||||
@@ -72,6 +72,14 @@ public class PreparedStatementPool {
|
||||
return holder;
|
||||
}
|
||||
|
||||
public void remove(PreparedStatementHolder stmtHolder) throws SQLException {
|
||||
if (stmtHolder == null) {
|
||||
return;
|
||||
}
|
||||
map.remove(stmtHolder.key);
|
||||
closeRemovedStatement(stmtHolder);
|
||||
}
|
||||
|
||||
public void put(PreparedStatementHolder stmtHolder) throws SQLException {
|
||||
PreparedStatement stmt = stmtHolder.statement;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user