docs: int prepareContext(Xid xid, boolean onePhaseCommit, long timeout) {
        PrepareTransactionOperation operation;
        Collection<Modification> modifications;
        try {
           modifications = toModification();
           if (trace) {
              log.tracef("Preparing transaction xid=%s, remote-cache=%s, modification-size=%d", xid, cacheName,
                    modifications.size());
           }
           if (modifications.isEmpty()) {
              return XAResource.XA_RDONLY;
           }
        } catch (Exception e) {
           return Integer.MIN_VALUE;
        }
        try {
           int xaReturnCode;
           do {
              operation = operationsFactory
                    .newPrepareTransactionOperation(xid, onePhaseCommit, modifications, recoverable, timeout);
              xaReturnCode = operation.execute().get();
           } while (operation.shouldRetry());
           return xaReturnCode;
        } catch (Exception e) {
           log.exceptionDuringPrepare(xid, e);
           return XAException.XA_RBROLLBACK;
        }
     }