Suppose we have following class
@Service
class MyClass {
public void testA() {
testB();
}
@Transactional
public void testB() { ..
You almost have it right. The proxy looks something more like this:
class Cglib$MyClass extends MyClass {
MyClass delegate;
@Override
public void testB() {
// ...do transactional things
delegate.testB();
}
}
Any call is forwarded by Spring which is why your nested annotations are not activated.
Also, if a virtual method like testA was overridden, Spring could not avoid to invoke the overridden method.