I use ehcache-spring-annotations 1.2.0 (Google code) with Spring 3.0.2.
I have annotated a DAO method with @Cacheable. The caching actually takes place (verified with logging and ehCache mbean). However, the method still takes 50 ms to 100 ms to execute when there is a cache hit.
At first, I suspected that a Hibernate transaction was still being created, so I created a separate class that uses the @Cacheable annotations, and delegates to the original DAO that uses the @Transactional annotation. It does not make any noticeable difference.
Am I doing something wrong, or do I have to lower my expectations?