Package javax.transaction

Examples of javax.transaction.TransactionRequiredException


        }

        // see 14.4.2.2 chapter EJB3
        if (throwable instanceof javax.ejb.TransactionRequiredLocalException) {
            if (isExtendingRmiRemote()) {
                TransactionRequiredException tre = new TransactionRequiredException(throwable.getMessage());
                tre.detail = throwable;
                return tre;
            }
            // else
            EJBTransactionRequiredException ejbTransRequiredException = new EJBTransactionRequiredException(throwable
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

            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

    public TxMandatory(TransactionManager transactionManager) throws SystemException, ApplicationException {
        super(TransactionType.Mandatory, transactionManager);

        clientTx = getTransaction();
        if (clientTx == null) {
            throw new ApplicationException(new TransactionRequiredException());
        }
    }
View Full Code Here

            context.clientTx = context.getTransactionManager().getTransaction();

            if (context.clientTx == null) {

                throw new ApplicationException(new TransactionRequiredException());
            }

            context.currentTx = context.clientTx;

        } catch (javax.transaction.SystemException se) {
View Full Code Here

            @Override
            public Object processInvocation(final InterceptorContext context) throws Exception {
                try {
                    return context.proceed();
                } catch (EJBTransactionRequiredException e) {
                    throw new TransactionRequiredException(e.getMessage());
                } catch (EJBTransactionRolledbackException e) {
                    throw new TransactionRolledbackException(e.getMessage());
                } catch (NoSuchEJBException e) {
                    throw new NoSuchObjectException(e.getMessage());
                } catch (NoSuchEntityException e) {
View Full Code Here

    public TxMandatory(TransactionManager transactionManager) throws SystemException, ApplicationException {
        super(TransactionType.Mandatory, transactionManager);

        clientTx = getTransaction();
        if (clientTx == null) {
            throw new ApplicationException(new TransactionRequiredException());
        }
    }
View Full Code Here

    catch (Exception caught) {
      assertEquals(ex, caught);
    }

    // Subclass of RemoteException
    ex = new TransactionRequiredException();
    try {
      proxied.echoException(1, ex);
      fail();
    }
    catch (TransactionRequiredException caught) {
View Full Code Here

        String[] theFinalStates1 = init1;

        Exception[] theExceptions = { null, null, null, null, null, null, null,
                null };

        TransactionRequiredException aTransactionRequiredException;
        int loopCount = init1.length;
        for (int i = 0; i < loopCount; i++) {
            try {
                aTransactionRequiredException = new TransactionRequiredException(
                        init1[i]);
                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

        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

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.