-->
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: Second-level cache problem
PostPosted: Thu Feb 05, 2004 5:09 pm 
Beginner
Beginner

Joined: Fri Jan 23, 2004 4:29 pm
Posts: 39
Can someone tell me what is wrong with my second-level cache configuration.

I have a class called Cat. The class has a collection called kittens. Everything is ok when I don't use the second-level cache.

But when I enable it (I'm using OsCache) the kittens collection always contains the same kittens. Even if the Cat is not the same.

Looking at the debug statements I see that the key for the collection is always kittens. Does this mean that there is only one kittens collection in the whole cache?

Code:
net.sf.hibernate.cache.QueryCache: checking cached query results in region: net.sf.hibernate.cache.QueryCache
com.opensymphony.oscache.base.algorithm.AbstractConcurrentReadCache: get called (key=net.sf.hibernate.cache.QueryKey@ee3bb1d)
com.opensymphony.oscache.base.algorithm.AbstractConcurrentReadCache: get called (key=kittens)
com.opensymphony.oscache.base.algorithm.AbstractConcurrentReadCache: persistRetrieve called (key=kittens)
com.opensymphony.oscache.base.Cache: No cache entry exists for key='kittens', creating


And how is the key determined? Should it not be the hashcode of the collection (kittens) object? Not the name of the instance variable.


Top
 Profile  
 
 Post subject: Fixed?
PostPosted: Tue Feb 17, 2004 3:12 pm 
Beginner
Beginner

Joined: Fri Jan 23, 2004 4:29 pm
Posts: 39
Setting the cache region to the class name seems to work.

Code:
criteria.setCacheRegion(Cat.class.getName());


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.