I have a situation where I have two beans defined which are of the same implementation class (ClassA) and implement the same interface (in this case InterfaceA):
I have defined the AOP configuration to wrap the processMessage call with transaction advice as follows:
The problem I have found is that the txAdvice only gets applied to the first bean (in this case beanA) and does not get applied to beanB. If I remove beanA from the application context, then beanB gets the transaction advice. This does not seem correct. I am using Spring 2.5.3. Any ideas on how to make the pointcut intercept calls to both beans processMessage method.
<bean id="beanA" class="com.sample.impl.ClassA"> </bean> <bean id="beanB" class="com.sample.impl.ClassA"> </bean>
<aop:config> <aop:advisor pointcut="execution(* com.sample.InterfaceA.processMessage(..))" advice-ref="txAdvice" /> </aop:config>