bug fixed for async closed

This commit is contained in:
wenshao
2014-12-05 23:27:36 +08:00
parent 55d238e94b
commit 9a2c2413c0
@@ -1085,6 +1085,17 @@ public class DruidPooledConnection extends PoolableWrapper implements javax.sql.
}
public void checkState() throws SQLException {
boolean asyncCloseEnable = this.getConnectionHolder().getDataSource().isAsyncCloseConnectionEnable();
if (asyncCloseEnable) {
synchronized (this) {
checkStateInternal();
}
} else {
checkStateInternal();
}
}
private void checkStateInternal() throws SQLException {
if (holder == null) {
if (disableError != null) {
throw new SQLException("connection holder is null", disableError);