-->
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: While executing HQL query ,will Hibernate use second leve
PostPosted: Fri Feb 15, 2008 6:06 am 
Regular
Regular

Joined: Wed Jun 20, 2007 1:53 am
Posts: 75
While executing HQL query ,will Hibernate use second level cache?

For example

Table : coded_sample

Sno identifier code meaning remarks
1 1001 CC1 coded sample1 sample code
2 1002 CC2 coded sample2 sample code
2 1003 CC3 coded sample2 sample code

entity name is : CodedSample


Second level cache introduced for CodedSample entity.

First and second records are loaded into memory by initial stage(by using load() of Hibernate session). Again I'm executing below query,

HQL : select identifier,code,meaning,remarks from CodedSample where identifier=1001;

Now, whether Hibernate will use second level cache or query hit the DB again?


Top
 Profile  
 
 Post subject:
PostPosted: Fri Feb 15, 2008 6:48 am 
Expert
Expert

Joined: Thu Jul 05, 2007 9:38 am
Posts: 287
The results of queries is only served from the cache if the cache is configured as query cache.

See the reference and this Article for details

http://www.devx.com/dbzone/Article/29685

Jens

_________________
Please rate useful posts.


Schauderhaft: Softwaredevelopment, Projectmanagement, Qualitymanagement and all things "schauderhaft"


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.