-->
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.  [ 5 posts ] 
Author Message
 Post subject: Proper use of Session get,load and find
PostPosted: Thu Jun 03, 2004 5:18 am 
Newbie

Joined: Thu Aug 28, 2003 7:14 am
Posts: 18
Hi,

I know in some variations this question have been raised, but reading the doc and various posts I can't be sure when is each method is properly used.

Can you please elaborate on the each method semantics? (like why can't I use get instead of find to check if the object exists etc.)

Thanks a lot.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jun 03, 2004 5:19 am 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
You should always use find() if you like to go all the way to the database and not hit some proxy or cache.

_________________
JAVA PERSISTENCE WITH HIBERNATE
http://jpwh.org
Get the book, training, and consulting for your Hibernate team.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jun 04, 2004 5:27 am 
Regular
Regular

Joined: Sat Feb 21, 2004 8:54 pm
Posts: 60
Location: Lakewood, California
christian wrote:
You should always use find() if you like to go all the way to the database and not hit some proxy or cache.


if you are doing something like:
Code:
session.find("select poio.poNew from PoItemOrdered as poio where poio.entityDeliverToId=?", entityId, Hibernate.STRING);

and you suspect that *many* of the entities returned will be proxied or in cache (or in the session?), is there a way to look there first?

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  
 
 Post subject:
PostPosted: Fri Jun 04, 2004 5:28 am 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
Enable the query cache.

_________________
JAVA PERSISTENCE WITH HIBERNATE
http://jpwh.org
Get the book, training, and consulting for your Hibernate team.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jun 04, 2004 11:49 pm 
Regular
Regular

Joined: Sat Feb 21, 2004 8:54 pm
Posts: 60
Location: Lakewood, California
christian wrote:
Enable the query cache.


thanks for the prompt reply.

btw, *great* book. chapter 4 is an real eye opener. i can hardly wait for the next chapter :)

_________________
<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.  [ 5 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.