Really lazy collection loading

Description

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
removed).
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
the objects.

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
contain too
many objects to fit into memory. It think that would be
a major
feature for Hibernate.

I need this, to be able to deal with collections that
contain
several thousands of big objects. Typically I need to
manipulate
one collection that contains 50000 objects of 6kbyte each.
It is currently impossible with Hibernate.
http://sourceforge.net/tracker/index.php?func=detail&aid=673173&group_id=40712&atid=428711

Environment

None

Assignee

Unassigned

Reporter

Max Rydahl Andersen

Labels

None

Feedback Requested

None

Feedback Requested By

None

backPortable

None

Suitable for new contributors

None

Pull Request

None

backportDecision

None

backportReEvaluate

None

Components

Priority

Minor
Configure