Created: 2008-05-27 02:39
Updated: 2018-12-07 16:34
License: apache-2.0



A library for using Memcached as a second level distributed cache in Hibernate.

  • Based on the excellent spymemcached client
  • Includes support for the Whalin (danga) memcached client
  • Supports entity and query caching.


If you have any questions, or just want to drop a line to say it's working great :) use the google-group.

Please note that this is an open source project. I work on it when I can and I implement what I feel like. I am volunteering my own free time for my own amusement.



As a result of these changes hibernate-memcached will miss on all cache requests upon upgrading to this version. This is due to the switch to Sha1KeyStrategy as the default. Hibernate-memcached will now generate different keys for the same data you were caching previously. Essentially, your cache will appear empty to Hibernate.

Also, as a result of these changes, 1.3 may not be binary compatible with any subclass hacks you may have written that extend HashCodeKeyStrategy, StringKeyStrategy, Md5KeyStrategy, or Sha1KeyStrategy. Note that the KeyStrategy interface and AbstractKeyStrategy have not changed at all. If you implemented/extended those directly you're fine.

  • Patch from @burtbeckwith to allow for memcached authentication via the spymemcached client. This can be specified using "hibernate.memcached.username" and "hibernate.memcached.password"


  • Patch from ddlatham to allow the spymemcached library to be put into daemon mode. This is accomplished by setting hibernate.memcached.daemonMode to true.
  • Updated the maven pom to pull in spymemcached 2.4.2 by default.

Note on Patches/Pull Requests

  • Fork the project.
  • Make your feature addition or bug fix.
  • Add tests for it. This is important so I don't break it in a future version unintentionally.
  • Commit, do not mess with pom.xml, version, or history. (if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)
  • Send me a pull request. Bonus points for topic branches.
Cookies help us deliver our services. By using our services, you agree to our use of cookies Learn more