-->
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: Some questions
PostPosted: Sat Dec 06, 2003 12:19 pm 
Regular
Regular

Joined: Thu Aug 28, 2003 6:30 am
Posts: 58
Hi alls

I set hibernate.cache.use_query_cache true and use query like this:
Code:
Query query = getSession().getNamedQuery(queryName);
query.setCacheable(true);
query.setCacheRegion("categoriesQuery");

but it always selects categories from DB not from cache. Also i use Ehcache and write for category class in ehcache.xml

Code:
<cache name="FeedbackCategory"
maxElementsInMemory="1000"
eternal="false"
timeToIdleSeconds="300"
timeToLiveSeconds="600"
overflowToDisk="true"
/>


What am i doing wrong ?


Also I have a design question - there're root categories list. Each root category has children categories. And in my system object has one category. I made lazy init for children categories. But it's work too slow when i need to show all root cateogries and children. How can i make such thing the best ?


And after switching to 2.1rc cglib2 writes errors
Code:
"19:16:07,806  INFO ReflectHelper:149 - reflection optimizer disabled for: FeedbackCategory, IllegalArgumentException: Cannot find matching method/constructor"


but i have 2 constructors:

Code:
protected FeedbackCategory() {
  }

  public FeedbackCategory(String code, PropertyHolder names, FeedbackCategory parent,
                          int position, boolean isStream, FeedbackCategoryType type)
      throws WrongPropertyException {
    init(code, names);
    setParent(parent);
    setPosition(position);
    setStream(isStream);
    setCategoryType(type);
  }


How to enable optimization ?

Thank's


Top
 Profile  
 
 Post subject:
PostPosted: Mon Dec 15, 2003 6:10 pm 
Proxool Developer
Proxool Developer

Joined: Tue Aug 26, 2003 10:42 am
Posts: 373
Location: Belgium
Don't know if you got an answer to your post...

We have exactly the same problem, and we found that everything works ok if you declare your argument-less constructor as public.

I'm not happy at all if that solution since I don't want to expose this constructor to someone else than Hibernate...

Moreover, the Hibernate reference documentation tells this constructor doesn't have to be public..

So I'm bit lost - any idea someone ?


Top
 Profile  
 
 Post subject:
PostPosted: Mon Dec 15, 2003 6:15 pm 
Proxool Developer
Proxool Developer

Joined: Tue Aug 26, 2003 10:42 am
Posts: 373
Location: Belgium
Having the reflection ptimizer disabled is not a big issue (cfr. http://www.hibernate.org/116.html#A9) - but I still wonder why it seems to need public constructors :-(


Top
 Profile  
 
 Post subject:
PostPosted: Tue Dec 16, 2003 7:15 am 
Regular
Regular

Joined: Thu Aug 28, 2003 6:30 am
Posts: 58
brenuart wrote:
Having the reflection ptimizer disabled is not a big issue (cfr. http://www.hibernate.org/116.html#A9) - but I still wonder why it seems to need public constructors :-(

Ops, it's very bad news. It requires not only public constructors but all properties. I don't understand why. Everything was OK in Hibernate 2.0.


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.