Hi,
In Spring
doc, it says
"Spring recommends that you only annotate concrete classes (and methods of concrete classes) with the @Transactional annotation, as opposed to annotating interfaces. You certainly can place the @Transactional annotation on an interface (or an interface method), but this works only as you would expect it to if you are using interface-based proxies. The fact that Java annotations are not inherited from interfaces means that if you are using class-based proxies (proxy-target-class="true") or the weaving-based aspect (mode="aspectj"), then the transaction settings are not recognized by the proxying and weaving infrastructure, and the object will not be wrapped in a transactional proxy, which would be decidedly bad.
I have a question regarding to the interface-based proxy and how it can see the @Transaction.
Suppose I have :
During runtime, the Spring AOP framework will generate a proxy for the GoodBankService:
According to the Spring doc above, putting @Transactional annoation in the interface works for the interfaced-based proxy (GoodBankServiceProxy). But it also says "Java annotations are not inherited from interfaces..."
My question is if GoodBankServiceProxy class does not inherit the @Transactional annotation from the BankService interface, how can this proxy execute the target object's openAccount method in the transaction ?