Mantis - Resin
Viewing Issue Advanced Details
453 minor always 11-13-05 00:00 12-07-05 15:28
karlgold  
 
normal  
closed 3.0.14  
3.0.14 fixed  
none    
none 3.0.16  
0000453: com.caucho.sql.UserConnection.isClosed() throws IllegalStateException when connection is closed
RSN-502
com.caucho.sql.UserConnection.isClosed() does this:

<snip>
 return getMConn() == null || getConnection() == null || getConnection().isClosed();
</snip>

getMConn() does this:

<snip>
  private ManagedConnectionImpl getMConn()
  {
    ManagedConnectionImpl mConn = _mConn;
    
    if (mConn == null)
      throw new IllegalStateException("connection is closed");

    return mConn;
  }
</snip>

thus, isClosed throws an IllegalStateException if _mConn is null. It seems like what you really want in isClosed() is something like:

<snip>
 return _mConn == null || getConnection() == null || getConnection().isClosed();
</snip>

Any

There are no notes attached to this issue.