Hi,
I would like to use a second level cache but I have some problems understanding how it works. First I don't understand the differences between read-write cache and nonstrict read-write cache .
But most importantly I have this code :
Code:
session1 = sessionFactory.openSession();
session2 = sessionFactory.openSession();
MyClass myObject1 = (MyClass) session1.load(MyClass.class, new Integer(1));
MyClass myObject2 = (MyClass) session2.load(MyClass.class, new Integer(1));
In this case the second load does not look into the cache but do a new request.
But if I do :
Code:
session1 = sessionFactory.openSession();
MyClass myObject1 = (MyClass) session1.load(MyClass.class, new Integer(1));
session2 = sessionFactory.openSession();
MyClass myObject2 = (MyClass) session2.load(MyClass.class, new Integer(1));
then the second load look into the jvm level cache.
I am using ehcache with default configuration. Is it something normal or not.
Finally is there a place where I can find a more comprehensive doc about cache than in the reference guide.
Thanks
Seb