I'm trying to make an independent call inside a method with transactional hook with following details :
@Transactional(transactionManager = "tenantTransactionManager", isolation = Isolation.REPEATABLE_READ, propagation = Propagation.REQUIRED)
void method1(){
//business logic 1
metohd2();
//business logic 2
}
method2(){
TransactionSynchronizationManager.registerSynchronization( new TransactionSynchronization() {
@Override
public void afterCommit( boolean readOnly ) {
//businessLogic to be done after commit
}
});
}
**EXPECTED BEHAVIOUR:**
- Transactions in method 1 should rollback is any exception occurs
- Transactions in method 2 should commit in any situation