In the spring container with the code below:
public class A { @Transactional public void m1() { ... b.m2();
when the transaction created for m2() ? when does the call to m2() end or call m1() ends?
When does @TransactionAttribute (TransactionAttributeType.REQUIRES_NEW) commit? answers it for EJB, but it doesn't seem to be like JPA behavior.
I debugged it, and I can see the effect of m2() on the DB after the end of m1() , but it seems strange to me, am I missing something here?
UPDATE:
I passed the object that I got in m1() to m2() and updated it from there. Thus, actually combining the object in m2() allows this and the correct answer of Mik378 .
java spring java-ee hibernate jpa
Ahmad Y. Saleh
source share