I am reading two things about lazy initialization which seem to conflict.
First, I defined many collection mapping without specifying lazy="false", because I understand that is the default. During run time, I find out I am getting LazyInitializationException when accessing the collection. Then I read you should call Hibernate.initialize(n.getChildren()) to make sure the collection is fetched.
Why didn't lazy default to false to start with? Do I really need to resort to Hibernate.initialize(getChildren()) each time?
|