debop / hibernate-redis

hibernate 2nd level cache privder using redis
Apache License 2.0
358 stars 182 forks source link

Concurrent access #25

Closed nottix closed 8 years ago

nottix commented 10 years ago

If two hibernate instance with hibernate-redis accesses concurrently at same resource, can occur a race condition?

  1. B make a slow query.
  2. A make a fast query and put a new element in cache, named test1 with value X;
  3. B finish its slow query and modify test1 element changing its value to Y.

But the most updated value is X.

debop commented 10 years ago

hibernate manage updatedTimestamp, check for needs update cache item. some kind test code please.

jonspalmer commented 8 years ago

There is now distributed Timestamper support added as part of this pull request: https://github.com/hibernate-redis/hibernate-redis/pull/2. I would hope that this fixes the problem you see but it would need to be tested.

Note that we are now maintaining an active fork an publishing releases from here: https://github.com/hibernate-redis/hibernate-redis

nottix commented 8 years ago

Thank you @bostanio

debop commented 8 years ago

@bostanio Thanks ^^