Announcement Announcement Module
Collapse

Spring Modules forum decommissioned in favor of Spring Extensions

As the Spring Modules project has been replaced by the Spring Extensions (http://www.springsource.org/extensions) project, this forum has been decommissioned in favour of Spring Extensions one at:
http://forum.springsource.org/forumdisplay.php?f=44

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.

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

  • spring-module-cache conflics with AspectJ style pointcuts

    Hi,

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

    Code:
    public interface SomeService {
    	@Cacheable(modelId="items")
    	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, 05:46 AM.
Working...
X