Announcement Announcement Module

Spring Modules forum decommissioned in favor of Spring Extensions

As the Spring Modules project has been replaced by the Spring Extensions ( project, this forum has been decommissioned in favour of Spring Extensions one at:

Please see the Spring Extensions home page for a complete list of current projects in Java, .NET and ActionScript. You can also propose one if you want.

Costin Leau
SpringSource - Spring Training, Consulting, and Support - "From the Source"
See more
See less
spring-module-cache conflics with AspectJ style pointcuts Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • spring-module-cache conflics with AspectJ style pointcuts


    We've just tried switching to the Spring2 / AspectJ style pointcuts for transaction demarcation. e.g.
        	<aop:pointcut id="servicePointcut" expression="execution(**Service.*(..))"/>
        	<aop:advisor pointcut-ref="servicePointcut" advice-ref="txRequired"/>
    <tx:advice id="txRequired" transaction-manager="transactionManager">
    		<tx:method name="*" propagation="REQUIRED"/>	
    However the service interfaces also specify caching via spring-module-cache, e.g.

    public interface SomeService {
    	public List<Item> getItems();
    When we've stopped using the NameMatching pointcut, spring-module-cache intercepted both the transactive proxy and the raw service, causing the cache to be hit twice.

    A side effect is that because the cache keys results on based the MethodInvocation, the results are stored twice [because the MethodInvoication is different for Proxy123.getItems() and realService.getItems()]

    For now we've switched back to the NameMatching pointcut, but it would be nice to get this working. Any ideas?
    Last edited by cressie176; Mar 15th, 2007, 04:46 AM.