Examples of InvalidTransactionException


Examples of javax.transaction.InvalidTransactionException

        return threadTransaction.get();
    }

    public void resume(final Transaction tx) throws InvalidTransactionException {
        if (tx == null) {
            throw new InvalidTransactionException("Transaction is null");
        }
        if (!(tx instanceof MyTransaction)) {
            throw new InvalidTransactionException("Unknown transaction type " + tx.getClass().getName());
        }
        final MyTransaction myTransaction = (MyTransaction) tx;

        if (threadTransaction.get() != null) {
            throw new IllegalStateException("A transaction is already active");
        }

        final int status = myTransaction.getStatus();
        if (status != Status.STATUS_ACTIVE && status != Status.STATUS_MARKED_ROLLBACK) {
            throw new InvalidTransactionException("Expected transaction to be STATUS_ACTIVE or STATUS_MARKED_ROLLBACK, but was " + status);
        }

        threadTransaction.set(myTransaction);
    }
View Full Code Here

Examples of javax.transaction.InvalidTransactionException

        if (getTransaction() != null)
            throw new IllegalStateException();

        if (tobj == null)
            throw new InvalidTransactionException();

        bindings.put(Thread.currentThread(), tobj);

    }
View Full Code Here

Examples of javax.transaction.InvalidTransactionException

        setTransactionalTransactionOperationsManger(true);
        try {
            if (getTransactionManager().getTransaction() != null)
                throw new TransactionalException(
                        "InvalidTransactionException thrown from TxType.NEVER transactional interceptor.",
                        new InvalidTransactionException("Managed bean with Transactional annotation and TxType of NEVER " +
                                "called inside a transaction context"));
            return proceed(ctx);
        } finally {
            resetTransactionOperationsManager();
        }
View Full Code Here

Examples of javax.transaction.InvalidTransactionException

        if (getTransaction() != null)
            throw new IllegalStateException();

        if (tobj == null)
            throw new InvalidTransactionException();

        bindings.put(Thread.currentThread(), tobj);

    }
View Full Code Here

Examples of javax.transaction.InvalidTransactionException

            TransactionRequiredException transactionRequiredException = new TransactionRequiredException(ex.getMessage());
            transactionRequiredException.detail = ex;
            return transactionRequiredException;
        }
        if (ex instanceof INVALID_TRANSACTION) {
            InvalidTransactionException invalidTransactionException = new InvalidTransactionException(ex.getMessage());
            invalidTransactionException.detail = ex;
            return invalidTransactionException;
        }
        if (ex instanceof OBJECT_NOT_EXIST) {
            NoSuchObjectException noSuchObjectException = new NoSuchObjectException(ex.getMessage());
View Full Code Here

Examples of javax.transaction.InvalidTransactionException

        if (getTransaction() != null)
            throw new IllegalStateException();

        if (tobj == null)
            throw new InvalidTransactionException();

        bindings.put(Thread.currentThread(), tobj);

    }
View Full Code Here

Examples of javax.transaction.InvalidTransactionException

    }

    public void resume(Transaction transaction) throws InvalidTransactionException, IllegalStateException, SystemException {
        if (log.isDebugEnabled()) { log.debug("resuming " + transaction); }
        if (transaction == null)
            throw new InvalidTransactionException("resumed transaction cannot be null");
        if (!(transaction instanceof BitronixTransaction))
            throw new InvalidTransactionException("resumed transaction must be an instance of BitronixTransaction");

        BitronixTransaction tx = (BitronixTransaction) transaction;
        if (getCurrentTransaction() != null)
            throw new IllegalStateException("a transaction is already running on this thread");
View Full Code Here

Examples of javax.transaction.InvalidTransactionException

            IllegalStateException, SystemException
    {
        if ( tobj == null || !(tobj instanceof TransactionImp) ) {
          String msg = "The specified transaction object is invalid for this configuration: " + tobj;
          Configuration.logWarning( msg );
            throw new InvalidTransactionException ( msg );
        }

        TransactionImp tximp = (TransactionImp) tobj;
        try {
            ctm_.resume ( tximp.getCT () );
View Full Code Here

Examples of javax.transaction.InvalidTransactionException

    private void associate(TransactionImpl tx) throws InvalidTransactionException {
        if (tx == null) throw new NullPointerException("tx is null");

        Object existingAssociation = associatedTransactions.putIfAbsent(tx, Thread.currentThread());
        if (existingAssociation != null) {
            throw new InvalidTransactionException("Specified transaction is already associated with another thread");
        }
        threadTx.set(tx);
        fireThreadAssociated(tx);
    }
View Full Code Here

Examples of javax.transaction.InvalidTransactionException

    public void resume(Transaction tx) throws IllegalStateException, InvalidTransactionException, SystemException {
        if (getTransaction() != null) {
            throw new IllegalStateException("Thread already associated with another transaction");
        }
        if (!(tx instanceof TransactionImpl)) {
            throw new InvalidTransactionException("Cannot resume foreign transaction: " + tx);
        }
        associate((TransactionImpl) tx);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.