Index: CPManagedConnectionFactory.java =================================================================== --- CPManagedConnectionFactory.java (revision 38253) +++ CPManagedConnectionFactory.java (working copy) @@ -147,8 +147,17 @@ mc.initializeConnectionType(ManagedConnection.ISPOOLEDCONNECTION); - //GJCINT - validateAndSetIsolation(mc); + try { + //GJCINT + validateAndSetIsolation(mc); + } catch (ResourceException re) { + try { + mc.destroy(); + } catch (ResourceException e) { + // Ignore exception in destroying managed connection + } + throw re; + } return mc; } Index: DMManagedConnectionFactory.java =================================================================== --- DMManagedConnectionFactory.java (revision 38253) +++ DMManagedConnectionFactory.java (working copy) @@ -160,9 +160,17 @@ com.sun.gjc.spi.ManagedConnection mc = constructManagedConnection( null, dsConn, pc, this); - //GJCINT - setIsolation(mc); - isValid(mc); + try { + //GJCINT + validateAndSetIsolation(mc); + } catch (ResourceException re) { + try { + mc.destroy(); + } catch (ResourceException e) { + // Ignore exception in destroying managed connection + } + throw re; + } return mc; } Index: DSManagedConnectionFactory.java =================================================================== --- DSManagedConnectionFactory.java (revision 38253) +++ DSManagedConnectionFactory.java (working copy) @@ -125,8 +125,17 @@ ManagedConnection mc = constructManagedConnection(null, dsConn, pc, this); - //GJCINT - validateAndSetIsolation(mc); + try { + //GJCINT + validateAndSetIsolation(mc); + } catch (ResourceException re) { + try { + mc.destroy(); + } catch (ResourceException e) { + // Ignore exception in destroying managed connection + } + throw re; + } return mc; } Index: XAManagedConnectionFactory.java =================================================================== --- XAManagedConnectionFactory.java (revision 38253) +++ XAManagedConnectionFactory.java (working copy) @@ -126,8 +126,17 @@ xaConn, null, pc, this); mc.initializeConnectionType(ManagedConnection.ISXACONNECTION); - //GJCINT - validateAndSetIsolation(mc); + try { + //GJCINT + validateAndSetIsolation(mc); + } catch (ResourceException re) { + try { + mc.destroy(); + } catch (ResourceException e) { + // Ignore exception in destroying managed connection + } + throw re; + } return mc; }