Package javax.transaction

Examples of javax.transaction.TransactionRequiredException


        String[] theFinalStates1 = { null };

        Exception[] theExceptions = { null };

        TransactionRequiredException aTransactionRequiredException;
        int loopCount = 1;
        for (int i = 0; i < loopCount; i++) {
            try {
                aTransactionRequiredException = new TransactionRequiredException();
                if (theExceptions[i] != null) {
                    fail();
                }
                assertEquals(i + "  Final state mismatch",
                        aTransactionRequiredException.getMessage(),
                        theFinalStates1[i]);

            } catch (Exception e) {
                if (theExceptions[i] == null) {
                    fail(i + "Unexpected exception");
View Full Code Here


        Logger logger = Logger.getLogger(ctx.getTarget().getClass().getName());
        logger.info("In MANDATORY TransactionalInterceptor");
        if(getTransactionManager().getTransaction() == null)
            throw new TransactionalException(
                    "TransactionRequiredException thrown from TxType.MANDATORY transactional interceptor.",
                    new TransactionRequiredException("Managed bean with Transactional annotation and TxType of " +
                                        "MANDATORY called outside of a transaction context"));
        return proceed(ctx);
    }
View Full Code Here

                     throw new TransactionRequiredLocalException(
                           "Transaction Required");
                  }
                  else
                  {
                     throw new TransactionRequiredException(
                           "Transaction Required");
                  }
               }

               // Associate it with the thread
View Full Code Here

                break;

            case MANDATORY:
                logInfo("Entering method with TX attribute MANDATORY [" + declaringType.getName() + '.' + method.getName() + ']');
                if (!isExistingTransaction(tm)) {
                    throw new TransactionRequiredException("No active TX at method with TX type set to MANDATORY [" + declaringType.getName() + '.' + method.getName() + "(..)]");
                }
                break;

            case NEVER:
                logInfo("Entering method with TX attribute NEVER [" + declaringType.getName() + '.' + method.getName() + ']');
View Full Code Here

        } else if (ex instanceof OBJECT_NOT_EXIST) {
            RemoteException newEx = new NoSuchObjectException(message);
            newEx.detail = ex;
            return newEx;
        } else if (ex instanceof TRANSACTION_REQUIRED) {
            RemoteException newEx = new TransactionRequiredException(message);
            newEx.detail = ex;
            return newEx;
        } else if (ex instanceof TRANSACTION_ROLLEDBACK) {
            RemoteException newEx = new TransactionRolledbackException(message);
            newEx.detail = ex;
View Full Code Here

        Logger logger = Logger.getLogger(ctx.getTarget().getClass().getName());
        logger.info("In MANDATORY TransactionalInterceptor");
        if(getTransactionManager().getTransaction() == null)
            throw new TransactionalException(
                    "TransactionRequiredException thrown from TxType.MANDATORY transactional interceptor.",
                    new TransactionRequiredException("Managed bean with Transactional annotation and TxType of " +
                                        "MANDATORY called outside of a transaction context"));
        return proceed(ctx);
    }
View Full Code Here

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

    public Object transactional(InvocationContext ctx) throws Exception {
        _logger.info("In MANDATORY TransactionalInterceptor");
        if(getTransactionManager().getTransaction() == null)
            throw new TransactionalException(
                    "TransactionRequiredException thrown from TxType.MANDATORY transactional interceptor.",
                    new TransactionRequiredException("Managed bean with Transactional annotation and TxType of " +
                                        "MANDATORY called outside of a transaction context"));
        return proceed(ctx);
    }
View Full Code Here

            TransactionRolledbackException transactionRolledbackException = new TransactionRolledbackException(ex.getMessage());
            transactionRolledbackException.detail = ex;
            return transactionRolledbackException;
        }
        if (ex instanceof TRANSACTION_REQUIRED) {
            TransactionRequiredException transactionRequiredException = new TransactionRequiredException(ex.getMessage());
            transactionRequiredException.detail = ex;
            return transactionRequiredException;
        }
        if (ex instanceof INVALID_TRANSACTION) {
            InvalidTransactionException invalidTransactionException = new InvalidTransactionException(ex.getMessage());
View Full Code Here

        } else if (ex instanceof OBJECT_NOT_EXIST) {
            RemoteException newEx = new NoSuchObjectException(message);
            newEx.detail = ex;
            return newEx;
        } else if (ex instanceof TRANSACTION_REQUIRED) {
            RemoteException newEx = new TransactionRequiredException(message);
            newEx.detail = ex;
            return newEx;
        } else if (ex instanceof TRANSACTION_ROLLEDBACK) {
            RemoteException newEx = new TransactionRolledbackException(message);
            newEx.detail = ex;
View Full Code Here

TOP

Related Classes of javax.transaction.TransactionRequiredException

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.