-->
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.  [ 3 posts ] 
Author Message
 Post subject: CacheMode.REFRESH ??
PostPosted: Mon Jun 20, 2005 11:38 am 
Regular
Regular

Joined: Thu Apr 21, 2005 9:05 am
Posts: 50
Location: Boston, U.S
I was readig through the documentation regarding caching, but i am not clear with the following lines....

CacheMode.REFRESH - write items to the second-level cache, but don't read from the second-level cache.

" If it does not read from second-level cache then what is the
real advantage of caching ".

I have been considering this option because in my application
the database might be updated by some other process other
than hibernate.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jun 20, 2005 4:49 pm 
Newbie

Joined: Mon Jun 20, 2005 4:23 pm
Posts: 1
Location: Austria
Hi,

you can modify the caching mechanism of a session by calling session.setCacheMode(...).

Therefore it is possible to finetune caching behavior on a per-query level according to your needs. And the CacheMode.REFRESH does what it is supposed to do - refreshing the cache.

For example if you know when another application modifies the database (most of time you dont know for sure) you could switch to caching mode REFRESH, issue a query that you know will update the cache with altered data and switch caching mode back to NORMAL.... (of course, this must be done very carefully but might help to improve performance in some situations).

max


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jun 20, 2005 5:32 pm 
Regular
Regular

Joined: Thu Apr 21, 2005 9:05 am
Posts: 50
Location: Boston, U.S
Hi max76,

Your reply is not convincing.
Anyway thanks for your time.

Regards


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 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:
cron
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.