Skip to content

sureshnath/hibernate-memcached

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Hibernate-memcached

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.

Help

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.

Versions

1.5

  • Compatible with hibernate 4.

  • Example config:

    <property name="hibernate.cache.region.factory_class">com.googlecode.hibernate.memcached.MemcachedRegionFactory</property> <property name="hibernate.memcached.operationTimeout">5000</property> <property name="hibernate.memcached.connectionFactory">KetamaConnectionFactory</property> <property name="hibernate.memcached.hashAlgorithm">HashAlgorithm.FNV1_64_HASH</property>

1.3

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"

1.2.2

  • 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.

About

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

Resources

License

Stars

Watchers

Forks

Packages

No packages published