I haven't seen this in the docs, and only one occasion on the list,
but we are having problems with hibernate-memcache and HQL update
statements. The singular objects don't get invalidated in the cache.
Our setup:
Hibernate 3.3.1.GA
Amazon ElastiCache
Jboss 5.1 GA
Scenario:
1) set a field on a single object, save it
2) update call on the db on many objects setting the same field with
HQL, via the entity manager
3) getting a single object via ID
After step 3) the result of step 2) doesn't reflect in the cache, we
display wrong state on our app.
This is scarry. Anyone have similar experience?
I used a workaround found on the list: select all objects for
updating, then save them individually. This way the cache was updated
properly.
http://groups.google.com/group/hibernate-memcached/browse_thread/thread/3bc685c2b7df3745#
"My only real theory is that Hibernate cannot guarantee consistency
in
the cache when doing HQL deletes like that because it doesn't know
what objects are cached and will be deleted by the query. Perhaps try
not doing deletes like that and instead query up the objects and then
use session.delete on them. "
But I'm disabling hibarnate-memcached until i don't get further info
on this.
Regards,
Laszlo
Laszlo,
If you can do some troubleshooting and let me know what you see going
on behind the scenes that would help a lot.
What version of hibernate-memcached are you using? Try using the
latest if you're not already. (1.3)
-Ray