3 Replies Latest reply on Jul 6, 2007 4:42 AM by fhh

    LazyInitializationException explination

    Dean Pullen Novice

      I'm trying to get the size of a collection of entities within a web page.
      I receive this error:

      [LazyInitializationException] failed to lazily initialize a collection of role:

      I understand this is because the hibernate session is closed after a http request, but I don't understand why or the process behind this. I also don't know how to correct this without forcing the Set to have an Eager load.

      Can anyone point me in the right direction to read up on the first/give me an explination, and could anyone directly explain how to resolve the issue correctly.