Hi, I'm the same problem with the second level cache disable.
After a some debugging, I have more antecedents about the problem.
My tomcat open two threads in my test environment, the first thread T1 and second T2. In both thread we query for the same object, an object A with id '1' from the table 'A_TABLE', where the age of A is 3 (A.age=3). Then we update the age of A in one of this thread, suppose T1 the other tread have stale data. Now in T1 A.age = 4 and finally make the commit. Now we query again the age of A in both threads, in T1 A.age=4 and in T2 A.age=3, and in the DB A_TABLE.age=4.
For any reason the hibernate session in T2 isn't refresh the data from de database. For each query, we are making a new SOA petition, and hibernate are using some threads for attending our petitions.
The current_session_context_class is setted to 'thread'.
[Time | A.age in T1 | A.age in T2 | A.age in DB]
[t1 | 3 | 3 | 3]
[t2 | 4 | 3 | 4]
[t3 | 4 | 3 | 4]
The session life cycle is managed by spring and the transactions are initialized by hand with session.getCurrentSession().beginTransaction().
Please, any help will be appreciate.
|