AArhin / simple-spring-memcached

Automatically exported from code.google.com/p/simple-spring-memcached
MIT License
0 stars 0 forks source link

Ability to order the cache advice #11

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
The cache advice currently runs after the @Transactional one, which means a 
transaction (and a DB hit) always occurs regardless of whether the cache is hit 
or not.

The order for the transactional advice can be set in the application context 
XML file like so:

<tx:annotation-driven order="2000" />

It would be nice to be able to do something similar to the Ehcache Spring 
annotation project (http://code.google.com/p/ehcache-spring-annotations/) where 
you can set the order like:

<ehcache:annotation-driven cache-manager="ehCacheManager" order="1000" />

This would also help the memcached advice play nicely with other advices 
(loggers, profilers, etc.).

Thanks!

Original issue reported on code.google.com by christop...@gmail.com on 27 Sep 2012 at 7:09

GoogleCodeExporter commented 9 years ago
Thank you for creating the issue.
I've committed to trunk new order for SSM cache advice so it runs before the 
@Transactional.
I still have to figure out how allow to customize this value (currently is 0).
The current snapshot artifacts (3.0.3-SNAPSHOT) contain this fix.

Original comment by ragno...@gmail.com on 27 Sep 2012 at 8:36

GoogleCodeExporter commented 9 years ago

Original comment by ragno...@gmail.com on 27 Sep 2012 at 8:37

GoogleCodeExporter commented 9 years ago
The order of SSM cache advice can be set using:

<bean class="com.google.code.ssm.Settings">
  <property name="order" value="100" />
</bean>

Original comment by ragno...@gmail.com on 30 Sep 2012 at 7:06

GoogleCodeExporter commented 9 years ago
Thanks for the quick turnaround! It looks great. :)

Do you have a mvn repo containing this snapshot by any chance? Otherwise I'll 
just wait for 3.0.3 to be released to try it.

Original comment by christop...@gmail.com on 3 Oct 2012 at 8:48

GoogleCodeExporter commented 9 years ago
Several last snapshot versions are available in OSS snapshot repository:

<repositories>
     <repository>
        <id>oss.snaphost</id>
        <name>OSS snapshots</name>
        <url>https://oss.sonatype.org/content/repositories/snapshots/</url>
        <snapshots>
           <enabled>true</enabled>
        </snapshots>
    </repository>
 </repositories>

Original comment by ragno...@gmail.com on 3 Oct 2012 at 8:53

GoogleCodeExporter commented 9 years ago
Version 3.1.0 has been released and deployed to central maven repository.

Original comment by ragno...@gmail.com on 9 Oct 2012 at 6:00

GoogleCodeExporter commented 9 years ago
Tried 3.1.0 from the maven repo and everything works as expected. Thanks!

Original comment by christop...@gmail.com on 9 Oct 2012 at 4:47

GoogleCodeExporter commented 9 years ago
Happy usage! Spread the word about SSM :)

Original comment by ragno...@gmail.com on 9 Oct 2012 at 4:57