Package org.exolab.castor.jdo

Examples of org.exolab.castor.jdo.TransactionNotInProgressException


     */
    public void commit() throws TransactionNotInProgressException, TransactionAbortedException {
        _log.debug("Committing tx");

        if (!isActive()) {
            throw new TransactionNotInProgressException(Messages.message("jdo.txNotInProgress"));
        }
       
        // if ( _ctx.getStatus() == Status.STATUS_MARKED_ROLLBACK )
        if (_ctx.getStatus() == 1) {
            throw new TransactionAbortedException(Messages.message("jdo.txRollback"));
View Full Code Here


     */
    public void rollback() throws TransactionNotInProgressException {
        _log.debug("Rolling back tx");

        if (!isActive()) {
            throw new TransactionNotInProgressException(Messages.message("jdo.txNotInProgress"));
        }
        _ctx.rollback();

        unregisterSynchronizables();
    }
View Full Code Here

    /**
     * {@inheritDoc}
     */
    public void lock(final Object object) throws PersistenceException {
        if (!isActive()) {
            throw new TransactionNotInProgressException(Messages.message("jdo.txNotInProgress"));
        }
        _ctx.writeLock(object, _lockTimeout);
    }
View Full Code Here

     * @return The current active transaction.
     * @throws TransactionNotInProgressException If there's no active transaction.
     */
    protected TransactionContext getTransaction() throws TransactionNotInProgressException {
        if (_scope == null) {
            throw new TransactionNotInProgressException(Messages.message("jdo.dbClosed"));
        }
        if (isActive()) {
            return _ctx;
        }
        throw new TransactionNotInProgressException(Messages.message("jdo.dbTxNotInProgress"));
    }
View Full Code Here

     *  has been closed
     */
    public Object nextIdentity() throws PersistenceException {
        // Make sure transaction is still open.
        if (_tx.getStatus() != Status.STATUS_ACTIVE) {
            throw new TransactionNotInProgressException(
                    Messages.message("persist.noTransaction"));
        }
        try {
            _lastIdentity = _query.nextIdentity(_lastIdentity);
        } catch (PersistenceException except) {
View Full Code Here

        ClassMolder     handler;
        Object           object;
       
        // Make sure transaction is still open.
        if (_tx.getStatus() != Status.STATUS_ACTIVE) {
            throw new TransactionNotInProgressException(Messages
                    .message("persist.noTransaction"));
        }
        if (_lastIdentity == null) {
            throw new IllegalStateException(Messages.message("jdo.fetchNoNextIdentity"));
        }
View Full Code Here

    public void lock( Object object )
        throws LockNotGrantedException, ObjectNotPersistentException,
               TransactionNotInProgressException,  PersistenceException
    {
        if ( _ctx == null || ! _ctx.isOpen() )
            throw new TransactionNotInProgressException( Messages.message( "jdo.txNotInProgress" ) );
        _ctx.writeLock( object, _lockTimeout );
    }
View Full Code Here

        throws TransactionNotInProgressException
    {
        TransactionContext tx;
       
        if ( _scope == null )
            throw new TransactionNotInProgressException( Messages.message( "jdo.dbClosed" ) );
        if ( _ctx != null && _ctx.isOpen()  )
            return _ctx;
        throw new TransactionNotInProgressException( Messages.message( "jdo.dbTxNotInProgress" ) );
    }
View Full Code Here

        if ( _transaction != null )
            throw new IllegalStateException( Messages.message( "jdo.txInJ2EE" ) );

        if ( _ctx == null || ! _ctx.isOpen() )
            throw new TransactionNotInProgressException( Messages.message( "jdo.txNotInProgress" ) );
        if ( _ctx.getStatus() == Status.STATUS_MARKED_ROLLBACK )
            throw new TransactionAbortedException( Messages.message( "jdo.txAborted" ) );
        try {
            _ctx.prepare();
            _ctx.commit();
View Full Code Here

        if ( _transaction != null )
            throw new IllegalStateException( Messages.message( "jdo.txInJ2EE" ) );

        // If inside XA transation throw IllegalStateException
        if ( _ctx == null || ! _ctx.isOpen() )
            throw new TransactionNotInProgressException( Messages.message( "jdo.txNotInProgress" ) );
        _ctx.rollback();
        _ctx = null;
    }
View Full Code Here

TOP

Related Classes of org.exolab.castor.jdo.TransactionNotInProgressException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.