[Opensymphony-oscache] Bug in OSCache + Hibernate Query Cache?
Handerson Ferreira Gomes <[email protected]> Fri, 29 Jul 2005 09:52:04 CDT
| Newsgroups | gmane.comp.java.open-symphony.os-cache |
|---|---|
| Message-ID | <18128858.1122648754523.JavaMail.os-j2ee@opensymphony01.contegix.com> |
Ok, I updated to Hibernate 2.1.8 and OSCache 2.1.1; the previous problem is fixed, the cached query is using the parameters to build the cache key. But now I'm facing another problem with the distributed cache. The Hibernate in Action book quote in chapter 7.6.3: "Hibernate expires a cached query result set when there is any insert, update, or delete of any row of a table that appears in the query." The behavior above happens in the JVM instance that is the source of the event, but despite the fact that the event is broadcasted and captured by all JGroups members, there is no effect in the cached query. The method cacheEntryFlushed is called for updates and delete, not for inserts, the OSCache/JavaGroupsBroadcastingListener is sending and receiving these events, but there is no changes in cache. (I enabled the log for the JavaGroupsBroadcastingListener and AbstractBroadcastingListener and they log messages like: AbstractBroadcastingListener - Cluster notification (type=1, data=10000795.com.etc.Object) was received. OSCacheEventListenerImpl - cacheEntryFlushed - key: 10000795.com.etc.Object CLUSTER So, if I have a queried cache in Server1 that initially return empty values, doesn't matter how many inserts (through Hibernate) I do in the Server2, the result of the same query in server1 will be 0 until the cache expires by timeout. If I delete an object in Server2, that is already cached in the Server1, the next time I run the query in the Server1 I get an exception from hibernate(StandardQueryCache), that try to load a flushed object that do not exists anymore in the database. I tested with JGroups 2.2.7 and 2.2.8 and the behavior is the same. Any help is appreciated. Thanks in advance. Handerson Gomes --------------------------------------------------------------------- Posted via Jive Forums http://forums.opensymphony.com/thread.jspa?threadID=4670&messageID=11671#11671