I've got two methods annotated with @Transactional
. The second method is called somewhere nested inside the first one.
Now I want the following behaviour to happen:
How do I have to set the Propagation
values to achieve such functionality?
P. S.: I'm using a HibernateTransactionManager.
You need to use NESTED. Note that this propagation mode uses JDBC SavePoints in order to achieve this behavior, and that the nested behavior thus only works if the transaction is just a wrapper around the JDBC connection. It won't work for JTA transactions. See the Spring documentation for more details.