docs: private void commitOnePhase(Xid xid) throws XAException {
      try {
        // Check preconditions
        if (xid.equals(preparedXid)) { // TODO: check if the condition should be negated
          throw new PGXAException(GT.tr("One-phase commit called for xid {0} but connection was prepared with xid {1}",
              xid, preparedXid), XAException.XAER_PROTO);
        }
        if (currentXid == null && !committedOrRolledBack) {
          // In fact, we don't know if xid is bogus, or if it just wasn't associated with this connection.
          // Assume it's our fault.
          // TODO: pick proper error message. Current one does not clarify what went wrong
          throw new PGXAException(GT.tr(
              "Not implemented: one-phase commit must be issued using the same connection that was used to start it", xid),
              XAException.XAER_RMERR);
        }
        if (!xid.equals(currentXid) || committedOrRolledBack) {
          throw new PGXAException(GT.tr("One-phase commit with unknown xid. commit xid={0}, currentXid={1}",
              xid, currentXid), XAException.XAER_NOTA);
        }
        if (state != State.ENDED) {
          throw new PGXAException(GT.tr("commit called before end. commit xid={0}, state={1}", xid, state), XAException.XAER_PROTO);
        }
  
        // Preconditions are met. Commit
        state = State.IDLE;
        currentXid = null;
        committedOrRolledBack = true;
  
        conn.commit();
        conn.setAutoCommit(localAutoCommitMode);
      } catch (SQLException ex) {
        throw new PGXAException(GT.tr("Error during one-phase commit. commit xid={0}", xid), ex, mapSQLStateToXAErrorCode(ex));
      }
    }