docs: @Override
      public final int prepare() throws XAException
      {
          if (tc.isEntryEnabled())
              Tr.entry(tc, "prepare", new Object[] { _resource, _xid });
          if (tcSummary.isDebugEnabled())
              Tr.debug(tcSummary, "xa_prepare", this);
  
          int rc = -1;
  
          try
          {
              try
              {
                  // Ensure that the associated XARecoveryData (the PartnerLogData entry in the PartnerLogTable)
                  // has logged itself to the partner log. If the PLD was created before the recovery log
                  // was available we need to ensure that it writes itself to the parter log now. Additionally,
                  // if this was the case, the recovery id it holds is updated from zero to the real value 
                  // so we need to update the value cached in this object (originally obtained during contruction
                  // from the pre-logged PLD).  If we logged at enlist time, this is a no-op.
                  _recoveryData.logRecoveryEntry();
              } catch (Exception e)
              {
                  throw new XAException(XAException.XAER_INVAL);
              }
  
              rc = _resource.prepare(_xid);
  
              //
              // Convert to Vote.
              //
              if (rc == XAResource.XA_OK)
              {
                  // Record the Vote
                  _vote = JTAResourceVote.commit;
                  return rc;
              }
              else if (rc == XAResource.XA_RDONLY)
              {
                  // Record the Vote
                  _vote = JTAResourceVote.readonly;
                  destroy();
                  return rc;
              }
          } catch (XAException xae)
          {
              _prepareXARC = xae.errorCode;
              // Record the prepare XA return code
              FFDCFilter.processException(xae, "com.ibm.ws.Transaction.JTA.JTAXAResourceImpl.prepare", "259", this);
  
              if (_prepareXARC >= XAException.XA_RBBASE && _prepareXARC <= XAException.XA_RBEND)
              {
                  _vote = JTAResourceVote.rollback;
              }
              else if (_prepareXARC == XAException.XAER_RMFAIL)
              {
                  // Force reconnect on rollback
                  _state = FAILED;
              }
  
              throw xae;
          } finally
          {
              if (tc.isEntryEnabled())
              {
                  if (_vote != null)
                  {
                      Tr.exit(tc, "prepare", XAReturnCodeHelper.convertXACode(rc) + " (" + _vote.name() + ")");
                  }
                  else
                  {
                      Tr.exit(tc, "prepare", XAReturnCodeHelper.convertXACode(rc));
                  }
              }
  
              if (tcSummary.isDebugEnabled())
                  Tr.debug(tcSummary, "xa_prepare result: " +
                                      XAReturnCodeHelper.convertXACode(rc));
          }
  
          // Any other response is invalid
          throw new XAException(XAException.XAER_INVAL);
      }