docs: @Override
      public boolean addSync() throws ResourceException {
  
          if (tc.isEntryEnabled()) {
              Tr.entry(this, tc, "addSync");
          }
  
          UOWCoordinator uowCoord = mcWrapper.getUOWCoordinator();
  
          if (uowCoord == null) {
              IllegalStateException e = new IllegalStateException("addSync: illegal state exception. uowCoord is null");
              Tr.error(tc, "ILLEGAL_STATE_EXCEPTION_J2CA0079", "addSync", e);
              if (tc.isEntryEnabled())
                  Tr.exit(this, tc, "addSync", e);
              throw e;
          }
  
          try {
              // added a second synchronization
              //
              // RRS Transactions don't follow the XA model, and therefore don't receive callbacks for
              // end, prepare, and commit/rollback.  Defect  added State Management for RRS
              // controlled transactions, and because the state on the adapter is, for XA transactions,
              // reset during the commit callback, we need to reset the adapter state as close as
              // possible after the commit time.  Therefore, we need to register as a priority sync
              // for the purpose of resetting the adapter state.  We need to also register as a normal
              // sync, however, because we have additional afterCompletion code that returns the
              // managed connection to the free pool.  This code must be executed AFTER DB2 gets its
              // afterCompletion callback.  DB2 is also registered as a priority sync, and since we
              // can't guarantee the order of the afterCompletion callbacks if two syncs are registered
              // as priority, we need to register as a regular sync to execute this part of the code.
              EmbeddableWebSphereTransactionManager tranMgr = mcWrapper.pm.connectorSvc.transactionManager;
              tranMgr.registerSynchronization(uowCoord, this); 
              final ManagedConnection mc = mcWrapper.getManagedConnection();
  
              // Registering a synchronization object with priority SYNC_TIER_RRS (3) allows the
              // synchronization to be called last.
              if (mc instanceof WSManagedConnection)
              {
                  tranMgr.registerSynchronization( 
                  uowCoord,
                                                  new Synchronization()
                                                  {
                                                      @Override
                                                      public void beforeCompletion() 
                                                      {
                                                      } 
  
                                                      @Override
                                                      public void afterCompletion(int status) 
                                                      {
                                                          ((WSManagedConnection) mc).afterCompletionRRS();
                                                      }
                                                  },
                                                  RegisteredSyncs.SYNC_TIER_RRS
                 );
              }
          } catch (Exception e) {
              com.ibm.ws.ffdc.FFDCFilter.processException(
                                                          e,
                                                          "com.ibm.ejs.j2c.RRSGlobalTransactionWrapper.addSync",
                                                          "238",
                                                          this);
              Tr.error(tc, "REGISTER_WITH_SYNCHRONIZATION_EXCP_J2CA0026", "addSync", e, "ResourceException");
              ResourceException re = new ResourceException("addSync: caught Exception");
              re.initCause(e); 
              if (tc.isEntryEnabled())
                  Tr.exit(this, tc, "addSync", e);
              throw re;
          }
          if (tc.isEntryEnabled()) {
              Tr.exit(this, tc, "addSync", true);
          }
          return true;
      }