I am using optimistic locking with JBoss Cache 1.3.0.SP2 and Hibernate 3.2.CR2. I went to optimistic locking due the problems with pessimistic locking and query caching, but optimistic locking is still having problems with query caching.
I originally posted to JBoss Cache forum, se, but it might be more relevant to Hibernate because it deals with invalidation of the UpdateTimestampsCache. I won't repeat the entire issue here unless you would like me to, see
http://jboss.org/index.html?module=bb&o ... 87#3946587.
I have disabled query caching in Hibernate and it is working fine, but I really need query caching.