-->
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.  [ 4 posts ] 
Author Message
 Post subject: Second level cache Strange beaviour
PostPosted: Wed Jun 23, 2004 4:12 am 
Newbie

Joined: Wed Jun 23, 2004 4:03 am
Posts: 5
Hi everybody ! I must do a test for the 2d level cache.
But I've stange results :

I'm doing an object with read-write strategie cache.

In my code :

Open session 1.
Open session 2.
Session 1 read the object by his id.
Session 2 read the object by his id.
My session1 update the object (and flush it).

My session 2 evict the object, an try to read the object by his id. Normally here the session 2 should found the object in the second level cache, but the traces say that the object is locked and session 2 go directly to database.

Anobody has an idea ?

Thanks in advance, Yann.

PS: excuse my poor enlgish (French).


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jun 23, 2004 10:05 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
Sounds like correct behavior to me. Try nonstrict-read-write if you don't care about transaction isolation.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jun 23, 2004 10:20 am 
Newbie

Joined: Wed Jun 23, 2004 4:03 am
Posts: 5
Thanks for your response gavin, but, normally if the session 1 has flushed her object, I think it shouldn't be locked any more, I'm wrong ? And each new session created after this failed to check the object in the 2d level cache until I send a refresh.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jun 23, 2004 11:27 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
If you want to understand how the second-level cache concurrency strategies enforce isolation, it is better to read the code and JavaDoc. I don't have time to explain it here.

People don't seem to appreciate just how sophisticated Hibernate's cache algorithms are, nor how difficult a problem caching is, in general.


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

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.