use of com.alibaba.druid.proxy.jdbc.PreparedStatementProxy in project druid by alibaba.
the class PreparedStatementPool method closeRemovedStatement.
public void closeRemovedStatement(PreparedStatementHolder holder) {
if (LOG.isDebugEnabled()) {
String message = null;
if (holder.statement instanceof PreparedStatementProxy) {
PreparedStatementProxy stmtProxy = (PreparedStatementProxy) holder.statement;
if (stmtProxy instanceof CallableStatementProxy) {
message = "{conn-" + stmtProxy.getConnectionProxy().getId() + ", cstmt-" + stmtProxy.getId() + "} exit cache";
} else {
message = "{conn-" + stmtProxy.getConnectionProxy().getId() + ", pstmt-" + stmtProxy.getId() + "} exit cache";
}
} else {
message = "stmt exit cache";
}
LOG.debug(message);
}
holder.setPooling(false);
if (holder.isInUse()) {
return;
}
if (holder.isEnterOracleImplicitCache()) {
try {
OracleUtils.exitImplicitCacheToClose(holder.statement);
} catch (Exception ex) {
LOG.error("exitImplicitCacheToClose error", ex);
}
}
dataSource.closePreapredStatement(holder);
}
Aggregations