public void commit()
            throws TransactionException
    {
        if (!_isInProgress)
        {
            throw new TransactionNotInProgressException(
                "Transaction not in progress, nothing to commit");
        }

        for (Iterator iterator = _listeners.iterator(); iterator.hasNext();)
        {
            TransactionListener listener = (TransactionListener) iterator.next();

            listener.transactionCommitting(this);
        }

        for (Iterator iterator = _connections.iterator(); iterator.hasNext();)
        {
            BaseConnection connection = (BaseConnection) iterator.next();
            ConcreteEditingContext context =
                    (ConcreteEditingContext) connection.getEditingContext();

            context.commit();
            connection.transactionPrepare();
        }

        for (Iterator iterator = _connections.iterator(); iterator.hasNext();)
        {
            BaseConnection connection = (BaseConnection) iterator.next();

            connection.transactionCommit();
            connection.setTransaction(null);
        }

        _connections.clear();
        _isInProgress = false;
    }
public void commit ( ) throws TransactionException { if ( ! _isInProgress ) { throw new TransactionNotInProgressException ( "Transaction not in progress, nothing to commit" ) ; } for ( Iterator iterator = _listeners . iterator ( ) ; iterator . hasNext ( ) ; ) { TransactionListener listener = ( TransactionListener ) iterator . next ( ) ; listener . transactionCommitting ( this ) ; } for ( Iterator iterator = _connections . iterator ( ) ; iterator . hasNext ( ) ; ) { BaseConnection connection = ( BaseConnection ) iterator . next ( ) ; ConcreteEditingContext context = ( ConcreteEditingContext ) connection . getEditingContext ( ) ; context . commit ( ) ; connection . transactionPrepare ( ) ; } for ( Iterator iterator = _connections . iterator ( ) ; iterator . hasNext ( ) ; ) { BaseConnection connection = ( BaseConnection ) iterator . next ( ) ; connection . transactionCommit ( ) ; connection . setTransaction ( null ) ; } _connections . clear ( ) ; _isInProgress = false ; }
Commit this transaction. A commit notifies all listeners of this transaction. It then
initiates a two phase commit on connections. Since, connections cannot be associated to
more than one transaction at any given point in time, there is no neccessity to identify
transaction.