I have businessClass having multiple methods.
When main entry method is called, it further calls other methods.
But only one method works with DB. So instead of wrapping all methods to Transaction advice, I want to apply only to a method. But it's not working for me.
Above only -- <aop:advisor advice-ref="txAdvice" pointcut-ref="xyzServiceOperations"/> --Code:<tx:advice id="txAdvice" transaction-manager="transactionManager"> <tx:attributes> <tx:method name="*" propagation="REQUIRED" rollback-for="com.xyz.general.lang.AbcException"/> </tx:attributes> </tx:advice> <aop:config> <aop:pointcut id="emailServiceOperation" expression="execution(* com.xyz.service.EmailService._insertEmailMessage(..))"/> <aop:pointcut id="emailServiceOperation2" expression="execution(* _insertEmailMessage(..))"/> <!-- For any method of class implementing this interface --> <aop:pointcut id="xyzServiceOperations" expression="execution(* *..AbcService.*(..))"/> <aop:advisor advice-ref="txAdvice" pointcut-ref="emailServiceOperation"/> <aop:advisor advice-ref="txAdvice" pointcut-ref="emailServiceOperation2"/> <aop:advisor advice-ref="txAdvice" pointcut-ref="xyzServiceOperations"/> </aop:config>
is working.
But i want to apply transaction boundaries to "_insertEmailMessage" method of EmailService (implements AbcService).
Is it possible? If anyone has done it?


Reply With Quote