bug fixed for async close

This commit is contained in:
wenshao
2014-12-06 18:05:16 +08:00
parent 565653d38d
commit 635ad55c15
@@ -1085,8 +1085,14 @@ public class DruidPooledConnection extends PoolableWrapper implements javax.sql.
}
public void checkState() throws SQLException {
boolean asyncCloseEnable = this.getConnectionHolder().getDataSource().isAsyncCloseConnectionEnable();
if (asyncCloseEnable) {
final boolean asyncCloseEnabled;
if (holder != null) {
asyncCloseEnabled = holder.getDataSource().isAsyncCloseConnectionEnable();
} else {
asyncCloseEnabled = false;
}
if (asyncCloseEnabled) {
synchronized (this) {
checkStateInternal();
}