File tree Expand file tree Collapse file tree 3 files changed +6
-4
lines changed
main/java/com/googlecode/hibernate/memcached
test/groovy/com/googlecode/hibernate/memcached Expand file tree Collapse file tree 3 files changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -54,7 +54,7 @@ public class MemcachedCache implements Cache {
5454 private final String clearIndexKey ;
5555 private int cacheTimeSeconds = 300 ;
5656 private boolean clearSupported = false ;
57- private KeyStrategy keyStrategy = new HashCodeKeyStrategy ();
57+ private KeyStrategy keyStrategy = new Sha1KeyStrategy ();
5858 private boolean dogpilePreventionEnabled = false ;
5959 private double dogpilePreventionExpirationFactor = 2 ;
6060
Original file line number Diff line number Diff line change 3737 * <td>Space delimited list of memcached instances in host:port format</td></tr>
3838 * <tr><td>hibernate.memcached.cacheTimeSeconds</td><td>300</td>
3939 * <td>The default number of seconds items should be cached. Can be overriden at the regon level.</td></tr>
40- * <tr><td>hibernate.memcached.keyStrategy</td><td>{@link HashCodeKeyStrategy }</td>
40+ * <tr><td>hibernate.memcached.keyStrategy</td><td>{@link Sha1KeyStrategy }</td>
4141 * <td>Sets the strategy class to to use for generating cache keys.
4242 * Must provide a class name that implements {@link com.googlecode.hibernate.memcached.KeyStrategy}</td></tr>
4343 * <tr><td>hibernate.memcached.readBufferSize</td>
@@ -199,4 +199,4 @@ public void stop() {
199199 public boolean isMinimalPutsEnabledByDefault () {
200200 return true ;
201201 }
202- }
202+ }
Original file line number Diff line number Diff line change @@ -25,6 +25,7 @@ class MemcachedCacheTest extends BaseTestCase {
2525 void test_dogpile_cache_miss () {
2626 MockMemcached mockCache = new MockMemcached ()
2727 cache = new MemcachedCache (" region" , mockCache)
28+ cache. setKeyStrategy(new HashCodeKeyStrategy ());
2829 cache. dogpilePreventionEnabled = true
2930 cache. cacheTimeSeconds = 1
3031 cache. dogpilePreventionExpirationFactor = 2
@@ -39,6 +40,7 @@ class MemcachedCacheTest extends BaseTestCase {
3940 void test_dogpile_cache_hit () {
4041 MockMemcached mockCache = new MockMemcached ()
4142 cache = new MemcachedCache (" region" , mockCache)
43+ cache. setKeyStrategy(new HashCodeKeyStrategy ());
4244 cache. dogpilePreventionEnabled = true
4345 cache. cacheTimeSeconds = 1
4446 cache. dogpilePreventionExpirationFactor = 2
@@ -48,4 +50,4 @@ class MemcachedCacheTest extends BaseTestCase {
4850 assertEquals MemcachedCache . DOGPILE_TOKEN , mockCache. cache[" region:0:3556498.dogpileTokenKey" ]
4951 }
5052
51- }
53+ }
You can’t perform that action at this time.
0 commit comments