code: @Override
      public void rollback(Xid xid) throws XAException {
  
          final boolean isTracingEnabled = TraceComponent.isAnyTracingEnabled();
  
          if (isTracingEnabled && tc.isEntryEnabled())
              Tr.entry(this, tc, "rollback");
  
          if (getMcWrapper().isMCAborted()) {
              Tr.exit(tc, "Connection was aborted. Exiting rollback.");
              return;
          }
  
          this.hasRollbackOccured = true;
  
          try {
              xaResource.rollback(xid);
          } catch (XAException e) {
              processXAException(e);
              com.ibm.ws.ffdc.FFDCFilter.processException(
                                                          e,
                                                          "com.ibm.ejs.j2c.XATransactionWrapper.rollback",
                                                          "755",
                                                          this);
              if (!mcWrapper.isStale()) {
                  Tr.error(tc, "XA_RESOURCE_ADAPTER_OPERATION_ID_EXCP_J2CA0027", "rollback", xid, e, mcWrapper.gConfigProps.cfName);
              }
              if (isTracingEnabled && tc.isEntryEnabled())
                  Tr.exit(this, tc, "rollback", e);
              throw e;
          } catch (Exception e) {
              com.ibm.ws.ffdc.FFDCFilter.processException(
                                                          e,
                                                          "com.ibm.ejs.j2c.XATransactionWrapper.rollback",
                                                          "761",
                                                          this);
              if (!mcWrapper.shouldBeDestroyed()) {
                  mcWrapper.markTransactionError();
                  Tr.error(tc, "XA_RESOURCE_ADAPTER_OPERATION_ID_EXCP_J2CA0027", "rollback", xid, e, mcWrapper.gConfigProps.cfName);
              }
              XAException x = new XAException("Exception:" + e.toString());
              x.initCause(e);
              if (isTracingEnabled && tc.isEntryEnabled())
                  Tr.exit(this, tc, "rollback", x);
              throw x;
          }
  
          if (isTracingEnabled && tc.isEntryEnabled())
              Tr.exit(this, tc, "rollback");
      }
docs: Inform the resource manager to roll back work done on behalf of a transaction branch
  
  @param xid - A global transaction identifier
  
  @throws XAException - An error has occurred