public void associateConnection(Object connection) throws ResourceException {
  if (!connectionSharing)   disassociateConnections();
  try {
    final FBConnection abstractConnection=(FBConnection)connection;
    abstractConnection.setManagedConnection(this);
    connectionHandles.add(abstractConnection);
  }
 catch (  ClassCastException cce) {
    throw new FBResourceException("invalid connection supplied to associateConnection.",cce);
  }
}

public void associateConnection ( Object connection ) throws ResourceException { if ( ! connectionSharing ) disassociateConnections ( ) ; try { final FBConnection abstractConnection = ( FBConnection ) connection ; abstractConnection . setManagedConnection ( this ) ; connectionHandles . add ( abstractConnection ) ; } catch ( ClassCastException cce ) { throw new FBResourceException ( "invalid connection supplied to associateConnection." , cce ) ; } }
used by the container to change the association of an application - level connection handle with a managedconneciton instance . the container should find the right managedconnection instance and call the associateconnection method . < p > the resource adapter is required to implement the associateconnection method . the method implementation for a managedconnection should dissociate the connection handle ( passed as a parameter ) from its currently associated managedconnection and associate the new connection handle with itself .
