-->
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.  [ 7 posts ] 
Author Message
 Post subject: Does Hibernate cache Object[] ?
PostPosted: Tue Nov 30, 2004 5:25 am 
Senior
Senior

Joined: Wed Dec 17, 2003 4:24 am
Posts: 188
Hi friends :

Anyone could tell me if hibernate cache object[] ? For example: I have a query like this:

Code:

String hql="select a.name,b.age,c.email from A a,B b,C c ";
List list=session.find(hql);
for(Iterator iter=list.iterator();iter.hasNext();){

   Object[] o=(Object[]) iter.next(); <-- Will Hibernate cache this Object[]?
...........................................
..........................................



I want to know whether hibernate will cache the object[] if I use session.iterator or session.find. Thks!

_________________
You are not alone...


Top
 Profile  
 
 Post subject: :(
PostPosted: Tue Nov 30, 2004 9:28 pm 
Senior
Senior

Joined: Wed Dec 17, 2003 4:24 am
Posts: 188
If I use HQL " from A a,B b,C c " ,hibernate will cache A,B and C POJO object. But if I select some property of this Class ,hibernate will cache them too? Help

_________________
You are not alone...


Top
 Profile  
 
 Post subject:
PostPosted: Wed Dec 01, 2004 4:10 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
hibernate caches *entities* and if you enable it hibernate also have a querycache that can cache *values*.

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject: :)
PostPosted: Wed Dec 01, 2004 6:44 am 
Senior
Senior

Joined: Wed Dec 17, 2003 4:24 am
Posts: 188
Thank you . It is useful if client don't use IE cache . :)

_________________
You are not alone...


Top
 Profile  
 
 Post subject:
PostPosted: Wed Dec 01, 2004 6:55 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
well - it depends on how long you have your session open ;)

...and I would really recommend you to read the hibernate action sections about caching, just to be sure you know the ramifications of different caching strategies.

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject: :)
PostPosted: Wed Dec 01, 2004 7:11 am 
Senior
Senior

Joined: Wed Dec 17, 2003 4:24 am
Posts: 188
Ok . query cache is a good idea. Hibernate in Action, I will try it. :)

_________________
You are not alone...


Top
 Profile  
 
 Post subject: Re: :)
PostPosted: Wed Dec 01, 2004 5:24 pm 
Regular
Regular

Joined: Sat Feb 21, 2004 8:54 pm
Posts: 60
Location: Lakewood, California
Yashnoo wrote:
Ok . query cache is a good idea. Hibernate in Action, I will try it. :)


the book is great.

but i have not gotten the query cache to work. please let me know if you have any luck.

thanks

_________________
<http://tayek.com/>, co-chair <http://www.ocjug.org/>, actively
seeking telecommuting work. hate spam?
<https://www1.ietf.org/mailman/listinfo/asrg>


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