core/src/main/java/com/orientechnologies/orient/core/tx/OTransactionOptimistic.java
@Override
  public void commit(final boolean force) {
    checkTransaction();

    if (txStartCounter < 0)
      throw new OStorageException("Invalid value of tx counter");

    if (force)
      txStartCounter = 0;
    else
      txStartCounter--;

    if (txStartCounter == 0) {
      doCommit();
    } else if (txStartCounter > 0)
      OLogManager.instance().debug(this, "Nested transaction was closed but transaction itself was not committed.");
    else
      throw new OTransactionException("Transaction was committed more times than it is started.");
  }
@Override
  public void commit(final boolean force) {
    checkTransaction();

    if (txStartCounter < 0)
      throw new OStorageException("Invalid value of tx counter");

    if (force)
      txStartCounter = 0;
    else
      txStartCounter--;

    if (txStartCounter == 0) {
      doCommit();
    } else if (txStartCounter > 0)
      OLogManager.instance().debug(this, "Nested transaction was closed but transaction itself was not committed.");
    else
      throw new OTransactionException("Transaction was committed more times than it is started.");
  }
The transaction is reentrant. If {@code begin()} has been called several times, the actual commit happens only after the same
amount of {@code commit()} calls

@param force commit transaction even