Package javax.transaction

Examples of javax.transaction.TransactionalException


                            "Managed bean with Transactional annotation and TxType of NOT_SUPPORTED " +
                                    "called inside a transaction context.  Suspending transaction failed due to " +
                                    exception;
                    _logger.log(java.util.logging.Level.INFO,
                        CDI_JTA_MBNOTSUPPORTEDTX, exception);
                    throw new TransactionalException(messageString, exception);
                }
            }
            Object proceed = null;
            try {
                proceed = proceed(ctx);
            } finally {
                if (transaction != null) {
                    try {
                        getTransactionManager().resume(transaction);
                    } catch (Exception exception) {
                        String messageString =
                                "Managed bean with Transactional annotation and TxType of NOT_SUPPORTED " +
                                        "encountered exception during resume " +
                                        exception;
                        throw new TransactionalException(messageString, exception);
                    }
                }
            }
            return proceed;
View Full Code Here


                String messageString =
                        "Managed bean with Transactional annotation and TxType of REQUIRES_NEW " +
                                "encountered exception during begin " +
                                exception;
                _logger.log(java.util.logging.Level.INFO, CDI_JTA_MBREQNEWBT, exception);
                throw new TransactionalException(messageString, exception);
            }
            Object proceed = null;
            try {
                proceed = proceed(ctx);
            } finally {
                try {
                    getTransactionManager().commit();
                } catch (Exception exception) {
                    String messageString =
                            "Managed bean with Transactional annotation and TxType of REQUIRES_NEW " +
                                    "encountered exception during commit " +
                                    exception;
                    _logger.log(java.util.logging.Level.INFO, CDI_JTA_MBREQNEWCT, exception);
                    throw new TransactionalException(messageString, exception);
                }
                if (suspendedTransaction != null) {
                    try {
                        getTransactionManager().resume(suspendedTransaction);
                    } catch (Exception exception) {
                        String messageString =
                                "Managed bean with Transactional annotation and TxType of REQUIRED " +
                                        "encountered exception during resume " +
                                        exception;
                        _logger.log(java.util.logging.Level.INFO, CDI_JTA_MBREQNEWRT, exception);
                        throw new TransactionalException(messageString, exception);
                    }
                }
            }
            return proceed;
View Full Code Here

        _logger.log(java.util.logging.Level.INFO, CDI_JTA_NEVER);
        if (isLifeCycleMethod(ctx)) return proceed(ctx);
        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 {
View Full Code Here

        _logger.log(java.util.logging.Level.INFO, CDI_JTA_MANDATORY);
        if (isLifeCycleMethod(ctx)) return proceed(ctx);
        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 {
View Full Code Here

        } catch (final Exception e) {
            error = e;
            if (illegalStateException == e) {
                throw e;
            }
            throw new TransactionalException(e.getMessage(), e);
        } finally {
            if (forbidsUt) {
                CoreUserTransaction.resetError(oldEx);
            }
View Full Code Here

                    String messageString =
                            "Managed bean with Transactional annotation and TxType of REQUIRED " +
                                    "encountered exception during begin " +
                                    exception;
                    _logger.info(messageString);
                    throw new TransactionalException(messageString, exception);
                }
                isTransactionStarted = true;
            }
            Object proceed = null;
            try {
                proceed = proceed(ctx);
            } finally {
                if (isTransactionStarted)
                    try {
                        getTransactionManager().commit();
                    } catch (Exception exception) {
                        String messageString =
                                "Managed bean with Transactional annotation and TxType of REQUIRED " +
                                        "encountered exception during commit " +
                                        exception;
                        _logger.info(messageString);
                        throw new TransactionalException(messageString, exception);
                    }
            }
            return proceed;
        } finally {
            resetTransactionOperationsManager();
View Full Code Here

                    String messageString =
                            "Managed bean with Transactional annotation and TxType of NOT_SUPPORTED " +
                                    "called inside a transaction context.  Suspending transaction failed due to " +
                                    exception;
                    _logger.info(messageString);
                    throw new TransactionalException(messageString, exception);
                }
            }
            Object proceed = null;
            try {
                proceed = proceed(ctx);
            } finally {
                if (transaction != null) {
                    try {
                        getTransactionManager().resume(transaction);
                    } catch (Exception exception) {
                        String messageString =
                                "Managed bean with Transactional annotation and TxType of NOT_SUPPORTED " +
                                        "encountered exception during resume " +
                                        exception;
                        throw new TransactionalException(messageString, exception);
                    }
                }
            }
            return proceed;
View Full Code Here

                String messageString =
                        "Managed bean with Transactional annotation and TxType of REQUIRES_NEW " +
                                "encountered exception during begin " +
                                exception;
                _logger.info(messageString);
                throw new TransactionalException(messageString, exception);
            }
            Object proceed = null;
            try {
                proceed = proceed(ctx);
            } finally {
                try {
                    getTransactionManager().commit();
                } catch (Exception exception) {
                    String messageString =
                            "Managed bean with Transactional annotation and TxType of REQUIRES_NEW " +
                                    "encountered exception during commit " +
                                    exception;
                    _logger.info(messageString);
                    throw new TransactionalException(messageString, exception);
                }
                if (suspendedTransaction != null) {
                    try {
                        getTransactionManager().resume(suspendedTransaction);
                    } catch (Exception exception) {
                        String messageString =
                                "Managed bean with Transactional annotation and TxType of REQUIRED " +
                                        "encountered exception during resume " +
                                        exception;
                        _logger.info(messageString);
                        throw new TransactionalException(messageString, exception);
                    }
                }
            }
            return proceed;
View Full Code Here

        _logger.info("In NEVER TransactionalInterceptor");
        if (isLifeCycleMethod(ctx)) return proceed(ctx);
        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 {
View Full Code Here

        _logger.info("In MANDATORY TransactionalInterceptor");
        if (isLifeCycleMethod(ctx)) return proceed(ctx);
        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 {
View Full Code Here

TOP

Related Classes of javax.transaction.TransactionalException

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.