• Bug
  • Status: Closed
  • 2 Major
  • Resolution: Fixed
  • ehcache-terracotta
  • cdennis
  • Reporter: guynir
  • February 15, 2010
  • 0
  • Watchers: 2
  • May 21, 2010
  • April 14, 2010


iBatis uses a non-serializable key to identify second-level cache objects. Due to this fact, EhCahe TIM is unable to serialize it and distribute the object. Using EhCache ‘identity’ mode, the following exception is generated (partial stack trace):

net.sf.ehcache.CacheException: java.io.NotSerializableException: com.ibatis.sqlmap.engine.cache.CacheKey at org.terracotta.modules.ehcache.store.ClusteredStore.generateStringKeyFor(ClusteredStore.java:237) at org.terracotta.modules.ehcache.store.ClusteredStore.get(ClusteredStore.java:112) at net.sf.ehcache.Cache.searchInMemoryStore(Cache.java:1319) at net.sf.ehcache.Cache.get(Cache.java:967)

For the best of my understanding, Terracotta should support objects of both types: serializable and non-serializable.


Fiona OShea 2010-03-10

What do you want to do from a PM perspective on this

Fiona OShea 2010-03-24

Is this general interest or a specific project? Have you tried serialised/express ehcache ?

Guy Nir 2010-03-24

I was testing Terracotta with EhCache for a specific project. However, during the tests, I encountered the exception described above.

iBatis uses native resources to identify a 2nd-level cache elements - such as JDBC connection (the connection is specific to the machine it was created on; cannot be propogated to a different machine regardless any serialization mechanism EhCache provides).

Tim Eck 2010-03-24


But true with identity mode we shouldn’t necessarily require serializable keys

Chris Dennis 2010-03-24

There was a bug in 1.7.2 whereby identity mode still required serializable keys. This was fixed in 2.0.0.

Fiona OShea 2010-04-13

Chris, is this resolved now? Or is there a question that still needs to go to PM?

Chris Dennis 2010-04-14

This is resolved as far as I am aware. The bug that caused identity caches to require serializable keys is fixed. There is still the fact that iBatis cannot be used in serialization mode because their keys are not serializable, but that is an iBatis bug.

Nitin Rana 2010-05-12

Fixed in the 2.0 release.