-->
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: QueryCache - The proper way to create QueryKey?
PostPosted: Mon Aug 07, 2006 6:26 pm 
Newbie

Joined: Sun Jan 15, 2006 5:56 am
Posts: 2
Hibernate version: 3.1.3
Oracle 9

I am trying to remove individual entries from a QueryCache region during runtime. I couldn't find it anywhere in the documentation the right way to do it so I had to do some search on the web and come up what I have right now. It is very hacky but I can't think of another way to do it.

Please tell me that there is a proper way to do this.

Currently my code is manually building the QueryKey base on the sql string(hibernate.show_sql) and then passing the QueryKey to the cache.remove() method.

Code:
...
QueryKey queryKey = new QueryKey(sqlQueryKey, parameters, null, EntityMode.POJO);
if(cache.get(queryKey) != null){
    cache.remove(queryKey);         
}
...


It works fine except when I need to update the sqlQueryKey each time the object model changes.

Is there a better way to to this? Perhaps either by overriding the QueryCache key or figuring out what the sqlQueryKey is for a particular query during runtime?


Top
 Profile  
 
 Post subject: re: QueryCache - The proper way to create QueryKey?
PostPosted: Tue Aug 08, 2006 2:59 pm 
Newbie

Joined: Sun Jan 15, 2006 5:56 am
Posts: 2
Does anybody have experience with manually removing query cache entries???


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.