-->
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.  [ 2 posts ] 
Author Message
 Post subject: Change concurrency strategy of second-level cache on the fly
PostPosted: Wed May 27, 2009 11:56 am 
Newbie

Joined: Wed May 20, 2009 12:06 pm
Posts: 2
Hello,

I use JPA and second-level cache in my project. They both worked fine so far.
Now, I have two applications,
1.The read-only application just read data from database, it doesn't modify the database at all. Therefore, I choose the "READ_ONLY" concurrency strategy for the second-level cache, aiming at a better performance.
2.The read-write application read and write as well the data of database, it modify the database. Consequently, I have to choose the "READ_WRITE" or "NONSTRICT_READ_WRITE" concurrency strategy for the second-level cache.

However, the concurrency strategy is assigned in the annotation of each entity class, so I cannot change it programatically. (I don't use class mapping files for JPA, so I can't use two mapping files, each for a different concurrency strategy for the same entity class.)

My Question is, is there a good way to change the concurrenty strategy of the second-level cache on the fly according to my 2 different applications?


Top
 Profile  
 
 Post subject: Re: Change concurrency strategy of second-level cache on the fly
PostPosted: Wed May 27, 2009 12:20 pm 
Newbie

Joined: Fri Apr 18, 2008 11:26 am
Posts: 11
Location: London
May be CacheMode class will help ? There is a option while you query to say Normal,Ignore, Put, Get and Refresh from the cache.

_________________
Kumar


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 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.