-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Second level cache usage
PostPosted: Thu Dec 18, 2003 9:18 am 
Expert
Expert

Joined: Thu Sep 04, 2003 8:23 am
Posts: 368
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


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.