This commit is contained in:
wenshao
2013-04-13 23:37:41 +08:00
16 changed files with 240 additions and 42 deletions
@@ -891,7 +891,7 @@ public class DruidDataSource extends DruidAbstractDataSource implements DruidDat
}
if (pooledConnection.getOwnerThread() != Thread.currentThread()) {
throw new SQLException("closed error, get/close not same thread");
LOG.warn("get/close not same thread");
}
final Connection physicalConnection = holder.getConnection();
@@ -1025,15 +1025,27 @@ public class DruidPooledConnection extends PoolableWrapper implements javax.sql.
public void checkState() throws SQLException {
if (holder == null) {
throw new SQLException("connection holder is null");
if (disableError != null) {
throw new SQLException("connection holder is null", disableError);
} else {
throw new SQLException("connection holder is null");
}
}
if (closed) {
throw new SQLException("connection closed");
if (disableError != null) {
throw new SQLException("connection closed", disableError);
} else {
throw new SQLException("connection closed");
}
}
if (disable) {
throw new SQLException("connection disabled", disableError);
if (disableError != null) {
throw new SQLException("connection disabled", disableError);
} else {
throw new SQLException("connection disabled");
}
}
}