@Override public Object processInvocation(final InterceptorContext context) throws Exception { try { return context.proceed(); } catch (EJBTransactionRequiredException e) { // this exception explicitly forbids initializing a cause throw copyStackTrace(new TransactionRequiredException(e.getMessage()), e); } catch (EJBTransactionRolledbackException e) { // this exception explicitly forbids initializing a cause throw copyStackTrace(new TransactionRolledbackException(e.getMessage()), e); } catch (NoSuchEJBException e) { // this exception explicitly forbids initializing a cause throw copyStackTrace(new NoSuchObjectException(e.getMessage()), e); } catch (NoSuchEntityException e) { // this exception explicitly forbids initializing a cause throw copyStackTrace(new NoSuchObjectException(e.getMessage()), e); } catch (EJBException e) { //as the create exception is not propagated the init method interceptor just stashes it in a ThreadLocal CreateException createException = popCreateException(); if (createException != null) { throw createException; } throw new RemoteException("Invocation failed", e); } } });
throw new TransactionRequiredLocalException(tre.getMessage());
throw new TransactionRequiredLocalException(tre.getMessage());
public TxMandatory(final TransactionManager transactionManager) throws SystemException, ApplicationException { super(TransactionType.Mandatory, transactionManager); clientTx = getTransaction(); if (clientTx == null) { throw new ApplicationException(new TransactionRequiredException()); } }
public TxMandatory(final TransactionManager transactionManager) throws SystemException, ApplicationException { super(TransactionType.Mandatory, transactionManager); clientTx = getTransaction(); if (clientTx == null) { throw new ApplicationException(new TransactionRequiredException()); } }
public TxMandatory(TransactionManager transactionManager) throws SystemException, ApplicationException { super(TransactionType.Mandatory, transactionManager); clientTx = getTransaction(); if (clientTx == null) { throw new ApplicationException(new TransactionRequiredException()); } }
@Override protected Object doIntercept(TransactionManager tm, Transaction tx, InvocationContext ic) throws Exception { if (tx == null) { throw new TransactionalException(jtaLogger.i18NLogger.get_tx_required(), new TransactionRequiredException()); } return invokeInCallerTx(ic, tx); } }
@Override protected Object doIntercept(TransactionManager tm, Transaction tx, InvocationContext ic) throws Exception { if (tx == null) { throw new TransactionalException(jtaLogger.i18NLogger.get_tx_required(), new TransactionRequiredException()); } return invokeInCallerTx(ic, tx); } }
@Override protected Object doIntercept(TransactionManager tm, Transaction tx, InvocationContext ic) throws Exception { if (tx == null) { throw new TransactionalException(jtaLogger.i18NLogger.get_tx_required(), new TransactionRequiredException()); } return invokeInCallerTx(ic, tx); } }
@Override protected Object doIntercept(TransactionManager tm, Transaction tx, InvocationContext ic) throws Exception { if (tx == null) { throw new TransactionalException(jtaLogger.i18NLogger.get_tx_required(), new TransactionRequiredException()); } return invokeInCallerTx(ic, tx); } }
} catch (Exception e) { remoteException = new TransactionRequiredException("TRANSACTION_REQUIRED");
@AroundInvoke public Object transactional(InvocationContext ctx) throws Exception { _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 { resetTransactionOperationsManager(); } }
case MANDATORY: if(transactionManager.getStatus() != Status.STATUS_ACTIVE) { throw new TransactionalException("Transaction required", new TransactionRequiredException());
RemoteException newEx = new TransactionRequiredException(message); newEx.detail = ex; return newEx;
RemoteException newEx = new TransactionRequiredException(message); newEx.detail = ex; return newEx;
@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) { throw new NoSuchObjectException(e.getMessage()); } catch (EJBException e) { //as the create exception is not propagated the init method interceptor just stashes it in a ThreadLocal CreateException createException = popCreateException(); if (createException != null) { throw createException; } throw new RemoteException("Invocation failed", e); } } });
return newEx; } else if (ex instanceof TRANSACTION_REQUIRED) { RemoteException newEx = new TransactionRequiredException(message); newEx.detail = ex; return newEx;
return preInvoke(txa); } catch (javax.ejb.TransactionRequiredLocalException e) { TransactionRequiredException tr = new TransactionRequiredException(e.getMessage()); tr.detail = e; throw tr;
/** * postInvoke for Remote access * @param rctx The RequestCtx that was returne t preInvoke() * @throws TransactionRequiredException * @throws TransactionRolledbackException * @throws NoSuchObjectException * @throws RemoteException postinvoke failed */ public void postInvokeRemote(RequestCtx rctx) throws RemoteException { if (TraceEjb.isDebugIc()) { TraceEjb.interp.log(BasicLevel.DEBUG, ""); } try { postInvoke(rctx); } catch (javax.ejb.TransactionRequiredLocalException e) { throw new javax.transaction.TransactionRequiredException(e.getMessage()); } catch (javax.ejb.TransactionRolledbackLocalException e) { throw new javax.transaction.TransactionRolledbackException(e.getMessage()); } catch (javax.ejb.NoSuchObjectLocalException e) { throw new java.rmi.NoSuchObjectException(e.getMessage()); } catch (javax.ejb.EJBException e) { throw new java.rmi.RemoteException(e.getMessage(), e); } }
throw new TransactionRequiredException( "Transaction Required");