When you call a method without @Transactional
within a transaction block, the parent transaction will propagate to the new method. It will use the same connection from the parent method (with @Transactional
) and any exception caused in the called method (without @Transactional
) will cause the transaction to rollback as configured in the transaction definition.
If you call a method with a @Transactional
annotation from a method with @Transactional
belonging to the same Spring Bean, then the called method's transactional behavior will not have any impact on the transaction. But if you call a method with a transaction definition from another method with a transaction definition, and they belong to different Spring Beans, then the code in the called method will follow its own transaction definitions.
You can find more details in the section Declarative transaction management of Spring Transaction Management documentation.
Spring declarative transaction model uses an AOP proxy, so the AOP proxy is responsible for the creation of the transactions. The AOP proxy will be active only if the called method belongs to a different Spring Bean
than the caller one.