mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
bug fixed for async closed
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user