EHC ❯ Implement custom cache concurrency strategy for clustered cache performance
-
Task
-
Status: Closed
-
1 Critical
-
Resolution: Incomplete
-
ehcache-core,ehcache-terracotta
-
-
cdennis
-
Reporter: amiller
-
December 09, 2009
-
0
-
Watchers: 0
-
February 22, 2010
-
January 20, 2010
Description
Implement custom versions of the Hibernate 3.2 CacheConcurrencyStrategy that replicate the changes we did in Hibernate Terracotta Cache Provider with instrumentation. These are not required to use the provider with clustered caches but can provide greater performance due to reduced locking with the knowledge of being used over Terracotta clustered caches.
The custom cache concurrency strategies have been created as part of the building of the Hibernate 3.3 cache implementation. They exist in ehcache-core in the package net.sf.ehcache.hibernate.ccs. However it seems to me there is no way to utilize the classes in Hibernate 3.2. I think the initial thought that using a custom concurrency strategy was possible was due to the fact that the hibernate-annotations Cache annotation that is applied to entities when configuring through annotations takes a a usage attribute of type CacheConcurrencyStrategy. Unfortunately this CacheConcurrencyStrategy type is a annotation type inside hibernate-annotations, and not the CacheConcurrencyStrategy interface inside hibernate-core. The CCS annotation type usage value in the Cache annotation is limited to the same four strategies that can be selected through XML configuration so selecting a custom strategy is not possible.
I’m closing this JIRA as incomplete because the solution is part way there since the new implementations exist, but cannot be finished since hibernate lacks the funcitonality. I’m going to leave the CCS classes in svn for the time being until we decide they are definitely useless, at which point they can be deleted.