-->
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: LazyInitializationException
PostPosted: Thu Aug 23, 2007 4:06 pm 
Newbie

Joined: Thu Aug 23, 2007 4:01 pm
Posts: 1
Location: Toronto
Could someone give me some more information on LazyInitializationException or to a good link where i can find some good explaination.

Thanks



Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp

[b]Hibernate version:[/b]

[b]Mapping documents:[/b]

[b]Code between sessionFactory.openSession() and session.close():[/b]

[b]Full stack trace of any exception that occurs:[/b]

[b]Name and version of the database you are using:[/b]

[b]The generated SQL (show_sql=true):[/b]

[b]Debug level Hibernate log excerpt:[/b]


Problems with Session and transaction handling?

Read this: http://hibernate.org/42.html


Top
 Profile  
 
 Post subject:
PostPosted: Fri Aug 24, 2007 5:18 am 
Beginner
Beginner

Joined: Tue Jul 04, 2006 11:29 am
Posts: 20
Location: Cambs, UK
There's a little bit on it here (and a little more in 19.1.4).

http://www.hibernate.org/hib_docs/v3/re ... ching-lazy

I'll try and explain this with my poor grasp of Hibernate :) In order to save on time & memory, Hibernate by default will only lazyily fetch any associated classes. This means that instead of fetching the class you wanted and all it's associated objects (which could be a lot of objects), it just returns a representation of the associated classes. When this representation is queried it is then that Hibernate goes off and fetches the details of that class.

There was some example code in that link that might help. Basically you have to make sure you are either accessing lazyily instantiated classes within a session, or you ensure the data you required is fetched in a non-lazy way. Chapter 19 of the reference documentation is good for this yet again:

http://www.hibernate.org/hib_docs/v3/re ... e-fetching

Anyway. I hope that helped slightly.


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.