dup close log configuable

This commit is contained in:
wenshao
2011-11-28 10:01:42 +08:00
parent cc7f1a5563
commit 6358a52e89
3 changed files with 19 additions and 5 deletions
@@ -56,10 +56,12 @@ public class PoolableConnection implements PooledConnection, Connection {
protected Connection conn;
protected ConnectionHolder holder;
protected TransactionInfo transactionInfo;
private final boolean dupCloseLogEnable;
public PoolableConnection(ConnectionHolder holder){
this.conn = holder.getConnection();
this.holder = holder;
dupCloseLogEnable = holder.getDataSource().isDupCloseLogEnable();
}
public SQLException handleException(Throwable t) throws SQLException {
@@ -115,7 +117,7 @@ public class PoolableConnection implements PooledConnection, Connection {
public void close() throws SQLException {
ConnectionHolder holder = this.holder;
if (holder == null) {
if (holder == null && dupCloseLogEnable) {
LOG.error("dup close");
return;
}