-->
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.  [ 1 post ] 
Author Message
 Post subject: query cache sometimes used and sometimes not used
PostPosted: Thu May 05, 2005 6:07 pm 
Beginner
Beginner

Joined: Fri Dec 17, 2004 8:30 pm
Posts: 20
The hibernate query cache only seems to work for some queries. What are the criteria for which queries are or are not cached?

When I call
query.setCacheable(true);
after a query, sometimes the query gets cached and sometimes it does not.

See the sql below to see a few of the queries that are not being cached.

Hibernate version:
3.0.2

The generated SQL (show_sql=true):
Hibernate: select fieldstrin0_.cobj as cobj__, fieldstrin0_.id as id__, fieldstrin0_.id as id0_, fieldstrin0_.val as val11_0_, fieldstrin0_.cobj as cobj11_0_, fieldstrin0_.meta as meta11_0_ from know.customobjfieldstringsearch fieldstrin0_ where fieldstrin0_.cobj=?
Hibernate: select objtype0_.id as col_0_0_ from know.objtype objtype0_ where objtype0_.visibility in (?) order by objtype0_.capitalizedSingularName
Hibernate: select this_.id as id0_, this_.visibility as visibility28_0_, this_.modStatus as modStatus28_0_, this_.whenCreated as whenCrea4_28_0_, this_.unumCreated as unumCrea5_28_0_, this_.whenModified as whenModi6_28_0_, this_.unumModified as unumModi7_28_0_, this_.capitalizedPluralName as capitali8_28_0_, this_.longDesc as longDesc28_0_, this_.isSuperset as isSuperset28_0_, this_.parent as parent28_0_, this_.capitalizedSingularName as capital12_28_0_ from know.objtype this_ order by this_.capitalizedPluralName asc
Hibernate: select this_.id as id0_, this_.visibility as visibility26_0_, this_.modStatus as modStatus26_0_, this_.whenCreated as whenCrea4_26_0_, this_.unumCreated as unumCrea5_26_0_, this_.whenModified as whenModi6_26_0_, this_.unumModified as unumModi7_26_0_, this_.longDesc as longDesc26_0_, this_.isSuperset as isSuperset26_0_, this_.capitalizedSingularName as capital10_26_0_ from know.listtype this_ order by this_.capitalizedSingularName asc
Hibernate: select this_.id as id0_, this_.listType as listType25_0_, this_.objType as objType25_0_ from know.listtypeallowed this_


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

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.