/** * Return the transaction status of the current method invocation. * Mainly intended for code that wants to set the current transaction * rollback-only but not throw an application exception. * @throws NoTransactionException if the transaction info cannot be found, * because the method was invoked outside an AOP invocation context */ public static TransactionStatus currentTransactionStatus() throws NoTransactionException { TransactionInfo info = currentTransactionInfo(); if (info == null || info.transactionStatus == null) { throw new NoTransactionException("No transaction aspect-managed TransactionStatus in scope"); } return info.transactionStatus; }
/** * Return the transaction status of the current method invocation. * Mainly intended for code that wants to set the current transaction * rollback-only but not throw an application exception. * @throws NoTransactionException if the transaction info cannot be found, * because the method was invoked outside an AOP invocation context */ public static TransactionStatus currentTransactionStatus() throws NoTransactionException { TransactionInfo info = currentTransactionInfo(); if (info == null || info.transactionStatus == null) { throw new NoTransactionException("No transaction aspect-managed TransactionStatus in scope"); } return info.transactionStatus; }
@Override public String getName() { // Assert that we're in the inner proxy TransactionInfo ti = TransactionAspectSupport.currentTransactionInfo(); assertFalse(ti.hasTransaction()); return spouseName; } };
@Override public String getName() { // Assert that we're in the inner proxy TransactionInfo ti = TransactionAspectSupport.currentTransactionInfo(); // Has nested transaction assertTrue(ti.hasTransaction()); assertEquals(innerTxatt, ti.getTransactionAttribute()); return spouseName; } };
@Override public void exceptional(Throwable t) throws Throwable { TransactionInfo ti = TransactionAspectSupport.currentTransactionInfo(); assertTrue(ti.hasTransaction()); assertEquals(spouseName, getSpouse().getName()); } };
@Override public void exceptional(Throwable t) throws Throwable { TransactionInfo ti = TransactionAspectSupport.currentTransactionInfo(); assertTrue(ti.hasTransaction()); assertEquals(outerTxatt, ti.getTransactionAttribute()); assertEquals(spouseName, getSpouse().getName()); } };
/** * Return the transaction status of the current method invocation. * Mainly intended for code that wants to set the current transaction * rollback-only but not throw an application exception. * @throws NoTransactionException if the transaction info cannot be found, * because the method was invoked outside an AOP invocation context */ public static TransactionStatus currentTransactionStatus() throws NoTransactionException { return currentTransactionInfo().transactionStatus; }
/** * Return the transaction status of the current method invocation. * Mainly intended for code that wants to set the current transaction * rollback-only but not throw an application exception. * @throws NoTransactionException if the transaction info cannot be found, * because the method was invoked outside an AOP invocation context */ public static TransactionStatus currentTransactionStatus() throws NoTransactionException { TransactionInfo info = currentTransactionInfo(); if (info == null || info.transactionStatus == null) { throw new NoTransactionException("No transaction aspect-managed TransactionStatus in scope"); } return info.transactionStatus; }
/** * Return the transaction status of the current method invocation. * Mainly intended for code that wants to set the current transaction * rollback-only but not throw an application exception. * @throws NoTransactionException if the transaction info cannot be found, * because the method was invoked outside an AOP invocation context */ public static TransactionStatus currentTransactionStatus() throws NoTransactionException { TransactionInfo info = currentTransactionInfo(); if (info == null || info.transactionStatus == null) { throw new NoTransactionException("No transaction aspect-managed TransactionStatus in scope"); } return info.transactionStatus; }
try txnInfo = TransactionAspectSupport.currentTransactionInfo();
try txnInfo = TransactionAspectSupport.currentTransactionInfo();