code: public void commit() throws RollbackException,
                                 HeuristicMixedException,
                                 HeuristicRollbackException,
                                 SecurityException,
                                 IllegalStateException,
                                 SystemException
     {
        Transaction tx = registry.getTransaction();
  
        if (tx == null)
           throw new SystemException();
  
        if (tx.getStatus() == Status.STATUS_ROLLING_BACK ||
            tx.getStatus() == Status.STATUS_ROLLEDBACK ||
            tx.getStatus() == Status.STATUS_MARKED_ROLLBACK)
           throw new RollbackException();
  
        registry.commitTransaction();
     }
docs: {@inheritDoc}