|
Hi all!
I have Hibernate program with use_query_cache ON and use_second_level_cache ON.
I have problem describet follow example.
1 Moment
When I execute some query createQuery("from Orders where status in (1,2) ") the Orders's Ids will saved Query Cache, and Orders's object will saved in SecondLevel Cache. The query returned 10 Orders (there are Orders with Id = 12345 (for example).
2. Moment
I execute load(Orders.class, new Integer(12345)); Hibernate finds this object from L2 (loaded on Moment 1) and no generate query from DB. I change Orders with Id = 12345 and save it without save to DB (Orders 12345 no evicted from L2).
3. Moment
When I execute query createQuery("from Orders where status in (1) ") the query return 7 Orders and among which there was also this record object Orders with Id = 12345.
What occurs ?
1. The Orders 12345 will refreshed from DB and change on Moment 2 was lost ? Or
2. The Orders 12345 no will change on 3 Moment ?
|