I have a transactional method that is called called multiple time (in a loop) by a method in the same class. This method in the same class is called by a method in a different class. From my investigation, when we call a transaction method within the same class, this has no effect. The same transaction is used. But in my case, will a new transaction be used?
Structure:
A.class - Method A
|-> B.class - Method A
|-> call mutiple times - B.class - @Transactional Method B
Can you advise?
My expectations is that a new transaction on Method B is created each time I loop through it. Do I need to pass the Method B to a different class? Or it will start a new transaction every time?