-->
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: Question about 2nd level cache and query cache
PostPosted: Fri Mar 02, 2007 10:01 pm 
Beginner
Beginner

Joined: Mon Sep 26, 2005 5:57 pm
Posts: 39
I am evaluating Alachisoft's Ncache as a 2nd level cache with NH 1.04.

I have noticed an unusual problem: When using the criteria API, the query results are being cached and are not refreshed from the database even when the criteria changes. When I set the "use_query_cache" to false, it works fine.

So is this a problem with Ncache or Nhibernate. Where should I look?


Thanks


Top
 Profile  
 
 Post subject:
PostPosted: Sat Mar 03, 2007 11:15 am 
Contributor
Contributor

Joined: Wed May 11, 2005 4:59 pm
Posts: 1766
Location: Prague, Czech Republic
It's quite easy to tell - try using a different provider (HashtableCacheProvider for example), and see what happens.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Mar 05, 2007 4:56 pm 
Senior
Senior

Joined: Sat Sep 10, 2005 3:46 pm
Posts: 178
This could be related to the problem that I noticed last week where certain cache providers do not store the query cache in the same regions. The problem is mentioned here http://forum.hibernate.org/viewtopic.php?t=971664


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 03, 2007 2:55 pm 
Beginner
Beginner

Joined: Mon Mar 06, 2006 2:19 pm
Posts: 42
Location: Belo Horizonte, Brazil
Hi. I have the same problem but using query and SysCache. I have something like:


"...From Adi A Where A.Contract = :contract and A.Id = :id"


:contract is an object
:id is a long

Even changing the object contract I get the same result from the cache.

If I turn off the 2nd level cache it works.
If I use A.Contract.Id = :contractId it works.

Is this a bug in my code?

Thanks.


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.