-->
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.  [ 6 posts ] 
Author Message
 Post subject: createCriteria not cacheable?
PostPosted: Fri Dec 12, 2003 2:58 pm 
Regular
Regular

Joined: Thu Dec 11, 2003 4:14 pm
Posts: 86
Location: Hibernate 3 + annotations, Oracle 9i, PostgreSQL 8.0, Java 1.5.0
Hello !

I am currently experimenting with hibernate for the first time.

We do have a self programmed persistence layer which maybe should be replace in the future.

One of the goodies with our layer is the possibility to programmatically create select/update/insert statements for the database (for sure, for some databases).
Much like your Criteria API.

To come to the point:
I think, i do not want to use Session.createQuery since this is too error-prone, and some developer might end in String operations to build the query.

Session.createCriteria is what i want, but i miss
.setCacheable(true) and .setCacheRegion()

hibernate debug and p6spy also showed me, that the same Criteria is executed to the database all the time.

do i misunderstand something here?


Top
 Profile  
 
 Post subject:
PostPosted: Sun Dec 14, 2003 2:41 am 
Regular
Regular

Joined: Thu Dec 11, 2003 4:14 pm
Posts: 86
Location: Hibernate 3 + annotations, Oracle 9i, PostgreSQL 8.0, Java 1.5.0
Just want to bring this up again!

I havent found any answer in the FAQ or Forum.

Thanks!
Mario


Top
 Profile  
 
 Post subject:
PostPosted: Sun Dec 14, 2003 5:19 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
Criteria queries are not yet cacheable.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Dec 15, 2003 4:24 am 
Regular
Regular

Joined: Thu Dec 11, 2003 4:14 pm
Posts: 86
Location: Hibernate 3 + annotations, Oracle 9i, PostgreSQL 8.0, Java 1.5.0
Might it be worth the time to dig into this, or do you have some technical reason (beside your spare time ;-) why this is currently not implemented?

I have already tried to understand the caching used with QueryCache.
Do you have a preferred direction how this sould be done?
Maybe, in the new year, i could try to implement/extend this to also allow this caching for the CriteriaAPI.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Dec 15, 2003 8:56 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
Ah, its on the TODO list, but so are *lots* of other things. Look at the current v21branch in CVS, and you can see how it is done for both SQLLoader and QueryTranslator. It should be reasonbly straightforward to extend the same thing to CriteriaLoader.

But make sure you work from current CVS, not from the source in 2.1final!


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jan 28, 2004 5:44 pm 
Regular
Regular

Joined: Thu Dec 11, 2003 4:14 pm
Posts: 86
Location: Hibernate 3 + annotations, Oracle 9i, PostgreSQL 8.0, Java 1.5.0
Here one could find the patch against v21branch to add the cacheable/cacheRegion to the Criteria API.

http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-660

Hope i have understand things right, comments are welcome.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 6 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.