@Test void testCommitTransaction_NoRollbackOnNestedTransaction() { Transaction transaction = testSubject.startTransaction(); when(underlyingTransactionStatus.isNewTransaction()).thenReturn(false); transaction.rollback(); verify(transactionManager, never()).rollback(underlyingTransactionStatus); }
@Override public Transaction startTransaction() { TransactionStatus status = transactionManager.getTransaction(transactionDefinition); return new Transaction() { @Override public void commit() { commitTransaction(status); } @Override public void rollback() { rollbackTransaction(status); } }; }
SpringTransactionManager implements TransactionManager { @Override public Transaction startTransaction() { TransactionStatus status = transactionManager.getTransaction(transactionDefinition); return new Transaction() { @Override public void commit() { commitTransaction(status); } @Override public void rollback() { rollbackTransaction(status); } }; } }
SpringTransactionManager implements TransactionManager { @Override public Transaction startTransaction() { TransactionStatus status = transactionManager.getTransaction(transactionDefinition); return new Transaction() { @Override public void commit() { commitTransaction(status); } @Override public void rollback() { rollbackTransaction(status); } }; } SpringTransactionManager(PlatformTransactionManager transactionManager,
                                    TransactionDefinition transactionDefinition);  SpringTransactionManager(PlatformTransactionManager transactionManager); }
SpringTransactionManager implements TransactionManager { @Override public Transaction startTransaction() { TransactionStatus status = transactionManager.getTransaction(transactionDefinition); return new Transaction() { @Override public void commit() { commitTransaction(status); } @Override public void rollback() { rollbackTransaction(status); } }; } SpringTransactionManager(PlatformTransactionManager transactionManager,
                                    TransactionDefinition transactionDefinition);  SpringTransactionManager(PlatformTransactionManager transactionManager); @Override Transaction startTransaction(); }
SpringTransactionManager implements TransactionManager { @Override public Transaction startTransaction() { TransactionStatus status = transactionManager.getTransaction(transactionDefinition); return new Transaction() { @Override public void commit() { commitTransaction(status); } @Override public void rollback() { rollbackTransaction(status); } }; } SpringTransactionManager(PlatformTransactionManager transactionManager,
                                    TransactionDefinition transactionDefinition);  SpringTransactionManager(PlatformTransactionManager transactionManager); @Override Transaction startTransaction();  }