Esempio n. 1
0
  /** Rolls back the active transaction, if any. */
  public void rollback() {
    if (!isTxnInProgress()) {
      return;
    }

    // NOTE jvs 12-Jan-2007:  see comment in commit() for ordering rationale

    state = State.NO_TXN;
    repos.endReposTxn(true);

    if (manageReposSession) {
      repos.endReposSession();
    }
  }
Esempio n. 2
0
  /** Commits the active transaction, if any. */
  public void commit() {
    if (!isTxnInProgress()) {
      return;
    }

    // NOTE jvs 12-Jan-2007:  change state BEFORE attempting
    // to end transaction; if endReposTxn throws an excn,
    // we're in an unknown state, but further calls could just
    // mask the original excn, so pretend we're back to
    // State.NO_TXN regardless.

    state = State.NO_TXN;
    repos.endReposTxn(false);

    if (manageReposSession) {
      repos.endReposSession();
    }
  }