-->
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: Session get() vs load()
PostPosted: Tue Oct 31, 2006 1:47 pm 
Newbie

Joined: Thu Oct 19, 2006 12:11 pm
Posts: 3
Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp

Hibernate version:3.2

I'm a newbie to hibernate 3 (haven't worked with older versions) and am trying to understand the difference between the get() and the load() methods of the Hibernate Session Object.

After reading the Hibernate documentation and the discussion at
http://www.jboss.com/index.html?module= ... sc&start=0 I think I know what those methods do. My code is giving the expected results also.


But I have following questions:

Is there any reason to favor one method over the other, besides the application specific considerations?

Is one of those two methods there just for backward compatibility or any other such reasons?

Thanks in advance.

Vikas


Top
 Profile  
 
 Post subject: Use get()
PostPosted: Tue Oct 31, 2006 7:42 pm 
Newbie

Joined: Fri Oct 27, 2006 6:53 pm
Posts: 3
I'd use get() because it doesn't return proxies and you will not have to worry about LazyInitializationExceptions then.

_________________
jim buswell


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.