Really lazy collection loading
It seems that the lazy collection loading implemented in
Hibernate loads all the objects in the collection when the
collection is accessed (an object is read, or added or
That means that it is impossible to have collections that
contain many objects.
It would be great to have the objects loaded in memory only
when they are retrieved from the collection, not all
I suggest the loaded objects are added to the session cache
only when they are added or retrieved from a collection,
and removed from memory when the session is flushed and if
they are no more referenced outside of the collection.
Then it would be possible to have collections that
many objects to fit into memory. It think that would be
feature for Hibernate.
I need this, to be able to deal with collections that
several thousands of big objects. Typically I need to
one collection that contains 50000 objects of 6kbyte each.
It is currently impossible with Hibernate.