Hibernate version: 1.2.6
database : SQLServer
I'm trying to use the second level cache to cache resultsets.
The configuration looks like:
Code:
hibernate.cache.use_query_cache true
Code:
List blogs = sess.createQuery("from Blog blog where blog.blogger = :blogger")
.setEntity("blogger", blogger)
.setCacheable(true)
.list();
The problem: When returning certain results the values are different from the ones in the database.
There are many threads accessing the code. Is it possible that the cached results are being used accessed by different threads?
E.g:
thread_1 : blogger.value = 1
thread_2 : blogger.value = 1
But in the database :
thread_2 : blogger.value = 2
Any idea? Is it because of the second level cache?
Thanks for your help.
chucky