code: @Override
     public void commit() throws RollbackException, HeuristicMixedException, HeuristicRollbackException, SecurityException, SystemException {
        if (trace) {
           log.tracef("Transaction.commit() invoked in transaction with Xid=%s", xid);
        }
        if (isDone()) {
           throw new IllegalStateException("Transaction is done. Cannot commit transaction.");
        }
        runPrepare();
        runCommit(false);
     }
docs: Attempt to commit this transaction.
  
  @throws RollbackException          If the transaction was marked for rollback only, the transaction is rolled back
  and this exception is thrown.
  @throws SystemException            If the transaction service fails in an unexpected way.
  @throws HeuristicMixedException    If a heuristic decision was made and some some parts of the transaction have
  been committed while other parts have been rolled back.
  @throws HeuristicRollbackException If a heuristic decision to roll back the transaction was made.
  @throws SecurityException          If the caller is not allowed to commit this transaction.