docs: @Override
      public void enlist() throws ResourceException {
  
          if (tc.isEntryEnabled()) {
              Tr.entry(this, tc, "enlist", mcWrapper.getUOWCoordinator());
          }
  
          if (this.hasRollbackOccured) {
              if (tc.isEntryEnabled())
                  Tr.exit(this, tc, "enlist", "It is NOT valid to continue working under a transaction that has already rolledback");
              throw new ResourceException("Attempt to continue working after transaction rolledback !");
          }
          if (enlisted == true) {
  
              if (tc.isEntryEnabled()) {
                  Tr.exit(this, tc, "enlist", "already enlisted");
              }
              return; // Already enlisted, no-op.
  
          } // end enlisted == true
  
          UOWCoordinator uowCoord = mcWrapper.getUOWCoordinator();
          if (uowCoord != null) {
              if (uowCoord.isGlobal()) {
                  // Global Transaction
                  EmbeddableWebSphereTransactionManager tranMgr = mcWrapper.pm.connectorSvc.transactionManager;
                  try {
                      if (_rrsTransactional) {
                          int branchCoupling = mcWrapper.getCm().getResourceRefInfo().getBranchCoupling();
                          int startFlag = XAResource.TMNOFLAGS;
                          if (branchCoupling != ResourceRefInfo.BRANCH_COUPLING_UNSET) {
                              startFlag = mcWrapper.getCm().supportsBranchCoupling(branchCoupling, mcWrapper.get_managedConnectionFactory());
                              if (startFlag == -1)
                                  throw new ResourceException("Branch coupling attribute not implemented for this resource");
                          }
  
                          mcWrapper.enlistRRSXAResource(mcWrapper.getRecoveryToken(), startFlag);
                      }
  
                      // Use the following enlist call since this is a One Phase resource.
                      boolean rc = false;
                      rc = tranMgr.enlistOnePhase(uowCoord, this);
                      if (rc != true) {
                          Tr.error(tc, "BAD_RETURN_VALUE_FROM_ENLIST_J2CA0087", this, mcWrapper.gConfigProps.cfName);
                          ResourceException x = new ResourceException("Error on enlistOnePhase");
                          if (tc.isEntryEnabled())
                              Tr.exit(this, tc, "enlist", x);
                          throw x;
                      }
                      mcWrapper.markLocalTransactionWrapperInUse();
                      enlisted = true;
                  } catch (ResourceException e) {
                      com.ibm.ws.ffdc.FFDCFilter.processException(
                                                                  e,
                                                                  "com.ibm.ejs.j2c.LocalTransactionWrapper.enlist",
                                                                  "344",
                                                                  this);
                      Tr.error(tc, "ENLIST_RESOURCE_EXCP_J2CA0030", "enlist", e, "Exception", mcWrapper.gConfigProps.cfName);
  
                      // Error recovery from enlist has been moved here.  The transaction team has
                      //  asked us to setRollbackOnly() for all the failed enlist() calls.  Doing
                      //  this causes them (for release 5.0. They may change it next release) to
                      //  flow the rollback sequence to all the other resources in the tran.  This
                      //  connection failed to enlist and so won't be called to roll back.  This
                      //  connection is, however registered for afterCompletion calls which they will
                      //  also drive.  Its important that we mark this connection stale prior to
                      //  calling setRollbackOnly() because our afterCompletion code will return it
                      //  to the freePool if we don't.  We want the connection destroyed since it
                      //  is potentially corrupt.
                      mcWrapper.markTransactionError();
                      try {
                          tranMgr.getTransaction().setRollbackOnly();
                      } catch (Exception ex) {
                          com.ibm.ws.ffdc.FFDCFilter.processException(ex, "com.ibm.ejs.j2c.LocalTransactionWrapper.enlist",
                                                                      "445", this);
                          if (tc.isEventEnabled()) {
                              Tr.event(this, tc,
                                       "Caught Exception while trying to mark transaction RollbackOnly - Exception:"
                                                 + ex);
                          }
                      }
  
                      if (tc.isEntryEnabled())
                          Tr.exit(this, tc, "enlist", e);
                      throw e;
                  } catch (Exception e) {
                      com.ibm.ws.ffdc.FFDCFilter.processException(
                                                                  e,
                                                                  "com.ibm.ejs.j2c.LocalTransactionWrapper.enlist",
                                                                  "459",
                                                                  this,
                                                                  new Object[] { mcWrapper }); //LI3162-5
                      Tr.error(tc, "ENLIST_RESOURCE_EXCP_J2CA0030", "enlist", e, "Exception", mcWrapper.gConfigProps.cfName);
  
                      // Error recovery from enlist has been moved here.  The transaction team has
                      //  asked us to setRollbackOnly() for all the failed enlist() calls.  Doing
                      //  this causes them (for release 5.0. They may change it next release) to
                      //  flow the rollback sequence to all the other resources in the tran.  This
                      //  connection failed to enlist and so won't be called to roll back.  This
                      //  connection is, however registered for afterCompletion calls which they will
                      //  also drive.  Its important that we mark this connection stale prior to
                      //  calling setRollbackOnly() because our afterCompletion code will return it
                      //  to the freePool if we don't.  We want the connection destroyed since it
                      //  is potentially corrupt.
                      mcWrapper.markTransactionError();
                      try {
                          tranMgr.getTransaction().setRollbackOnly();
                      } catch (Exception ex) {
                          com.ibm.ws.ffdc.FFDCFilter.processException(ex, "com.ibm.ejs.j2c.LocalTransactionWrapper.enlist",
                                                                      "477", this);
                          if (tc.isEventEnabled()) {
                              Tr.event(this, tc,
                                       "Caught Exception while trying to mark transaction RollbackOnly - Exception:"
                                                 + ex);
                          }
                      }
  
                      ResourceException re = new ResourceException("enlist: caught Exception");
                      re.initCause(e);
                      if (tc.isEntryEnabled())
                          Tr.exit(this, tc, "enlist", re);
                      throw re;
                  }
                  if (tc.isEntryEnabled()) {
                      Tr.exit(this, tc, "enlist");
                  }
                  return;
              } // end Global Transaction
              else {
                  // Local Transaction
                  try {
                      if (_rrsTransactional) {
                          int dummyInt = -1;
                          rrsXAResource = mcWrapper.enlistRRSXAResource(dummyInt, dummyInt);
                      }
  
                      // If the resolution is CONTAINER_AT_BOUNDARY then do a straight enlist.
                      // The transaction service will manage begin/end of this transaction.
                      if (((LocalTransactionCoordinator) uowCoord).isContainerResolved()) {
                          ((LocalTransactionCoordinator) uowCoord).enlist(this);
                      } else {
                          // If resolution is NOT CONTAINER_AT_BOUNDARY, we assume it is APPLICATION,
                          //  (which is the only other choice and also the default) then do an
                          //  enistForCleanup.  Here the application is expected to commit/rollback
                          //  the local transaction.  If it does, we will get an event in our
                          //  connectionEventListener and it will drive delist() on this object,
                          //  which in turn will call delistFromCleanup. If the user doesn't
                          //  commit/rollback the transaction service will clean things up.
                          ((LocalTransactionCoordinator) uowCoord).enlistForCleanup(this);
                      }
                      mcWrapper.markLocalTransactionWrapperInUse();
                      enlisted = true;
                  } catch (Exception e) {
                      com.ibm.ws.ffdc.FFDCFilter.processException(
                                                                  e,
                                                                  "com.ibm.ejs.j2c.LocalTransactionWrapper.enlist",
                                                                  "405",
                                                                  this);
                      mcWrapper.markTransactionError();
                      mcWrapper.releaseToPoolManager();
                      Tr.error(tc, "ENLIST_RESOURCE_EXCP_J2CA0030", "enlist", e, "Exception", mcWrapper.gConfigProps.cfName);
                      ResourceException re = new ResourceException("enlist: caught Exception");
                      re.initCause(e);
                      if (tc.isEntryEnabled())
                          Tr.exit(this, tc, "enlist", e);
                      throw re;
                  }
                  if (tc.isEntryEnabled()) {
                      Tr.exit(this, tc, "enlist", "Local Tran");
                  }
                  return;
              } // end Local Transaction
          } else {
              // No transaction context.  Should never happen.
              Tr.error(tc, "NO_VALID_TRANSACTION_CONTEXT_J2CA0040", "enlist", null, mcWrapper.gConfigProps.cfName);
              ResourceException x = new ResourceException("INTERNAL ERROR: No valid transaction context present");
              if (tc.isEntryEnabled())
                  Tr.exit(this, tc, "enlist", x);
              throw x;
          }
  
      }