Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
The moose likes Object Relational Mapping and the fly likes could not initialize proxy - the owning Session was closed Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "could not initialize proxy - the owning Session was closed" Watch "could not initialize proxy - the owning Session was closed" New topic
Author

could not initialize proxy - the owning Session was closed

Naresh Chaurasia
Ranch Hand

Joined: May 18, 2005
Posts: 356
I am trying to use hibernat template to execute the following code


When the following line



is executed I get the following error.

org.hibernate.LazyInitializationException: could not initialize proxy - the owning Session was closed


My config files are as follows:


Location.hbm.xml




Event.hbm.xml



By any chance is the following line

closing the session. If you look at the config files, i have not defined any association, so lazy loading is not in picture. I am not able to understand why i get this error.
Can some help to understand the concept.


SCJP 1.4, SCWCD1.4, OCA(1Z0-007)
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: could not initialize proxy - the owning Session was closed
 
Similar Threads
ClassCastException Hibernate
Hibernate, User and Address with association table between
failed to lazily initialize a collection of role hibernate3
Hibernate Maping error
Invalid mapping document. No grammar found