code: @Override
      public boolean isSameRM(XAResource xaResource) throws XAException {
          if (this.equals(xaResource)) { // if the same object
              LOG.debug("PhynixxXAResource[" + this.getId() + "]:isSameRM isSameRM");
              return true; // then definitely the same RM
          }
          if (!(xaResource instanceof PhynixxXAResource)) {
              // if it's not one of our wrappers
              LOG.debug("PhynixxXAResource[" + this.getId() + "]:isSameRM not isSameRM");
              return false; // then it's definitely not the same RM
          }
          @SuppressWarnings({ "unchecked", "rawtypes" })
          PhynixxXAResource<C> sampleXARes = (PhynixxXAResource) xaResource;
  
          try {
              // cast to something more convenient
              if (xaResourceFactory.equals(sampleXARes.xaResourceFactory)) {
                  // if they originate from same data source
                  LOG.debug("PhynixxXAResource[" + this.getId() + "]:isSameRM isSameRM (equal XAResourceFactory)");
                  return true; // then they're the same RM
              } else {
                  LOG.debug("PhynixxXAResource[" + this.getId() + "]:isSameRM not isSameRM (not equal XAResourceFactory)");
                  return false;
              }
          } catch (Exception ex) {
              LOG.error("PhynixxXAResource.isSameRM(" + sampleXARes.xaId + ") on XAResourceProgressState " + this.xaId
                      + " :: " + ex + "\n" + ExceptionUtils.getStackTrace(ex));
              throw new DelegatedRuntimeException("isSameRM(" + sampleXARes.xaId + ") on XAResourceProgressState "
                      + this.xaId, ex);
  
          }
      }
docs: This method is called to determine if the resource manager instance
  represented by the target object is the same as the resource manager
  instance represented by the parameter xares .
  
  The resource manager is reresented by the ResourceFactory.
  
  @param xaResource
  An XAResource object.
  @return true if same RM instance; otherwise false.