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