hazelcast vs ehcache

We tried both of them for one of the largest online classifieds and e-commerce platform. We started with ehcache/terracotta(server array) cause it’s well-known, backed by Terracotta and has bigger community support than hazelcast. When we get it on production environment(distributed,beyond one node cluster) things changed, our backend architecture became really expensive so we decided to … Read more

Caching with Hibernate + Spring – some Questions

Hibernate supports the following Caches: 1st Level Cache, 2nd Level Cache, Query Cache Yes. Spring itself supports the following Caching possibilities: just Method Caching Spring 3.1 introduces the new caching abstraction based on annotations around methods, yes. The 1st Level Cache is part of EVERY Hibernate application. Yes. The 1st Level Cache is created for … Read more

Another unnamed CacheManager already exists in the same VM (ehCache 2.5)

Your EhCacheManagerFactoryBean may be a singleton, but it’s building multiple CacheManagers and trying to give them the same name. That violates Ehcache 2.5 semantics. Versions of Ehcache before version 2.5 allowed any number of CacheManagers with the same name (same configuration resource) to exist in a JVM. Ehcache 2.5 and higher does not allow multiple … Read more

@Cacheable key on multiple method arguments

Update: Current Spring cache implementation uses all method parameters as the cache key if not specified otherwise. If you want to use selected keys, refer to Arjan’s answer which uses SpEL list {#isbn, #includeUsed} which is the simplest way to create unique keys. From Spring Documentation The default key generation strategy changed with the release … Read more

How to differentiate between time to live and time to idle in ehcache

timeToIdleSeconds enables cached object to be kept in as long as it is requested in periods shorter than timeToIdleSeconds. timeToLiveSeconds will make the cached object be invalidated after that many seconds regardless of how many times or when it was requested. Let’s say that timeToIdleSeconds = 3. Then the object will be invalidated if it … Read more

Spring Cache @Cacheable – not working while calling from another method of the same bean

I believe this is how it works. From what I remember reading, there is a proxy class generated that intercepts all requests and responds with the cached value, but ‘internal’ calls within the same class will not get the cached value. From https://code.google.com/p/ehcache-spring-annotations/wiki/UsingCacheable Only external method calls coming in through the proxy are intercepted. This … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)