Closed GoogleCodeExporter closed 9 years ago
Subclassing the HashCodeKeyStrategy was a terrible idea in retrospect.
Either of the digest strategies would solve this problem if they were using the
StringKeyStrategy.
I think a proper solution would be to have the digest based strategies extend
the AbstractKeyStrategy and delegate to HashCodeKeyStrategy with a
configuration option to have it delegate to StringKeyStrategy instead.
I'd gladly accept a patch implementing such a change :)
Original comment by raykrue...@gmail.com
on 30 Mar 2011 at 12:31
On a whim I dove in and tore up the key strategies. Essentially Sha1KeyStrategy
is now the default, and the recommended, key strategy. It uses the toString()
and hashCode() values together. Essentially the key is sha1(region + clearIndex
+ key.toString() + key.hashCode()). Hibernate already implements toString() on
all of it's key objects in order to support OsCache and others.
I've deployed a 1.3-SNAPSHOT jar out to the repo. Pull it down and give it a
shot.
You can manually grab it from
http://raykrueger.googlecode.com/svn/repository/com/googlecode/hibernate-memcach
ed/1.3-SNAPSHOT/
Original comment by raykrue...@gmail.com
on 6 Apr 2011 at 4:58
Looks good, I will give it a try.
I noticed that MemcachedCache.keyStrategy is still initialized to
HashCodeKeyStrategy, but then configured to use Sha1KeyStrategy.
Original comment by ddlat...@gmail.com
on 7 Apr 2011 at 10:24
Can you point me to that? Not sure what you mean.
Original comment by raykrue...@gmail.com
on 7 Apr 2011 at 10:25
Err nevermind, I see it.
Thanks
Original comment by raykrue...@gmail.com
on 7 Apr 2011 at 10:30
Ok Fixed that up. Thanks for catching it.
I'm going out drinking now :)
Original comment by raykrue...@gmail.com
on 7 Apr 2011 at 11:11
This issue can now be closed as it's fixed in 1.3
Original comment by ddlat...@gmail.com
on 18 Aug 2011 at 4:29
heh great! Thanks for circling back, I guess I should put out an official 1.3
release then.
Original comment by raykrue...@gmail.com
on 18 Aug 2011 at 4:32
Original issue reported on code.google.com by
ddlat...@gmail.com
on 29 Mar 2011 at 11:50