in proxy mode (which was the default), only external method calls coming in through the proxy is intercepted. This means is self-invocation, in effect, a method within the target object calling another method of the target object, Would not leads to a actual transaction at runtime even if the invoked method was marked with
@Transactional .
Spring Document Address:
http://docs.spring.io/spring/docs/4.2.0.RC1/spring-framework-reference/htmlsingle/#transaction-declarative-annotations
Description: In proxy mode, only external method calls are intercepted and transactions are opened. Class internal calls cannot implement transaction control.
Error Example:
Public class Tx { publicvoid A () { B (); } = propagation.required) publicvoid B () { }}
Correct example:
Public class Tx { = propagation.required) publicvoid A () { B (); } Public void B () { }}
Transaction does not work Closing non transactional sqlsession