docs: public void associateConnection(Object connection) throws ResourceException {
          final boolean isTraceOn = TraceComponent.isAnyTracingEnabled();
  
          if (isTraceOn && tc.isEntryEnabled()) 
              Tr.entry(this, tc, "associateConnection", connection);
  
          WSJdbcConnection connHandle = (WSJdbcConnection) connection;
  
          // JDBC Handles do not support reassociation during a transaction because of the
          // inability to reassociate "child" handles. (Statement, ResultSet, ...)
          // Therefore, we do not reassociate the handle, but instead "reserve" it for token
          // reassociation back to the same MC.  This relies on the guarantee we will always
          // be reassociated back to the original MC for use during the same transaction.
  
          try {
              WSRdbManagedConnectionImpl oldMC =
                              (WSRdbManagedConnectionImpl) connHandle.getManagedConnection(key);
  
              int tranState = oldMC == null ?
                              WSStateManager.NO_TRANSACTION_ACTIVE :
                              oldMC.stateMgr.transtate;
  
              // store the value just in case.
              if (oldMC != null) {
                  if (isTraceOn && tc.isDebugEnabled())
                      Tr.debug(this, tc, "Old ManagedConnection rrsGlobalTransactionReallyActive :",
                               Boolean.valueOf(oldMC.rrsGlobalTransactionReallyActive)); 
  
                  rrsGlobalTransactionReallyActive = oldMC.rrsGlobalTransactionReallyActive;
              }
  
              if (isTraceOn && tc.isDebugEnabled()) 
              {
                  Tr.debug(this, tc, "Old ManagedConnection transaction state:",
                           oldMC == null ? null : oldMC.getTransactionStateAsString());
  
                  Tr.debug(this, tc, "New ManagedConnection transaction state:",
                           this.getTransactionStateAsString());
              }
  
              // The CRI must be retrieved from the connection handle when we are certain the
              // handle is inactive since handles only keep track of the CRI when they are
              // inactive. 
  
              Object newCRI; 
  
              if ((tranState == WSStateManager.GLOBAL_TRANSACTION_ACTIVE
                   || (tranState == WSStateManager.RRS_GLOBAL_TRANSACTION_ACTIVE) // to be on the safe side, we don't want to check for rrsGlobalTransactionReallyActive here will take the case where its not really started.
                   || tranState == WSStateManager.LOCAL_TRANSACTION_ACTIVE)
                  && !connHandle.isReserved()) {
                  if (isTraceOn && tc.isEventEnabled())
                      Tr.event(this, tc, 
                               "Reassociation requested within a transaction; " +
                                               "handle reassociation will be ignored.");
  
                  // A transaction is active; ignore the reassociation, but mark the handle as
                  // reserved for its current ManagedConnection.
  
                  connHandle.reserve(key);
  
                  // Drop the handle from its current ManagedConnection. We may not be able to
                  // drop handle's reference to the ManagedConnection, but we can at least drop
                  // the ManagedConnection's reference to the handle.
  
                  oldMC.dissociateHandle(connHandle);
  
                  newCRI = connHandle.getCRI(); 
              }
  
              else {
                  // No transaction is active, so a full reassociation is allowed.
  
                  // If the handle is still ACTIVE, dissociate it from its previous MC.
  
                  if (connHandle.getState() == WSJdbcConnection.State.ACTIVE)
                      connHandle.dissociate();
  
                  // Retrieve the CRI while the handle is inactive.
  
                  newCRI = connHandle.getCRI(); 
  
                  //  - The connection handle must be supplied with both the new
                  // ManagedConnection and underlying JDBC Connection.  The handle will handle
                  // making the state of the new underlying Connection consistent with the
                  // previously held one.
  
                  connHandle.reassociate(this, sqlConn, key);
              }
  
              if (!cri.equals(newCRI))
                  replaceCRI((WSConnectionRequestInfoImpl) newCRI); 
  
              // Avoid resetting properties when a handle has already been created. 
  
              if (numHandlesInUse == 0) 
              {
                  // Refresh our copy of the connectionSharing setting with each first connection handle
                  connectionSharing = dsConfig.get().connectionSharing; 
  
                  synchronizePropertiesWithCRI(); //  - Synchronize the connection properties with CRI
              }
  
              addHandle(connHandle); 
          } catch (ResourceException resX) {
              FFDCFilter.processException(resX,
                                          "com.ibm.ws.rsadapter.spi.WSRdbManagedConnectionImpl.associateConnection",
                                          "1981", this);
  
              if (isTraceOn && tc.isEntryEnabled())
                  Tr.exit(this, tc, "associateConnection", "Exception"); 
              throw resX;
          }
  
          if (isTraceOn && tc.isEntryEnabled()) 
              Tr.exit(this, tc, "associateConnection");
      }