improved oracle pscache error handle.

This commit is contained in:
wenshao
2017-10-03 02:18:07 +08:00
parent 98496a2e5d
commit 57cd092e0b
3 changed files with 25 additions and 5 deletions
@@ -22,6 +22,7 @@ import java.security.AccessController;
import java.security.PrivilegedAction;
import java.sql.Connection;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.ConcurrentModificationException;
@@ -438,6 +439,17 @@ public class DruidDataSource extends DruidAbstractDataSource implements DruidDat
this.setConnectionProperties(property);
}
}
{
String property = properties.getProperty("druid.maxPoolPreparedStatementPerConnectionSize");
if (property != null && property.length() > 0) {
try {
int value = Integer.parseInt(property);
this.setMaxPoolPreparedStatementPerConnectionSize(value);
} catch (NumberFormatException e) {
LOG.error("illegal property 'druid.maxPoolPreparedStatementPerConnectionSize'", e);
}
}
}
}
public boolean isKillWhenSocketReadTimeout() {
@@ -1443,6 +1455,12 @@ public class DruidDataSource extends DruidAbstractDataSource implements DruidDat
}
if (requireDiscard) {
if (holder.statementTrace != null) {
for (Statement stmt : holder.statementTrace) {
JdbcUtils.close(stmt);
}
}
this.discardConnection(holder.getConnection());
holder.setDiscard(true);
}