I have a question about lazy loading that I haven't able to answer. My
situation will take some explaining so please bear with me.

I have a complex graph of very large objects (each object is on the
order of hundreds of MB). Most of the objects have a three level
inheritance hierarchy that looks like:

Super1
|
|
Super2
|
|
Subclass

Class Super1 contains several small properties and class Super2 contains
a (large) short[]. NOTE: The short[] is saved by using a Usertype
similar to the Blob pattern given on the Hibernate website. The subclass
adds several more properties to be saved including a Set of additional
Subclasses (which are different than the encapsulating class).

So a part of the object graph looks something like:

          -> Subclass2
Subclass1 -> Subclass2
          -> Subclass2

Each Subclass2 could also have a set of Subclasses as well. So, as you
can see the object graph can become very large (in terms of memory
usage)

To save on memory requirements the set of subclasses is initialized
lazily. This way the huge binary blobs of data are only loaded on
demand. 

As the program runs, the binary data of different objects is needed, but
it is never necessary (or possible due to memory restrictions) to load
the binary components of the entire object graph. I would like to allow
my objects to "forget" about their binary components without having to
hit the database or cause the persistent state of the object to be
changed.

This is where the subject of this message comes in. Is there any way to
return a initialized lazy object or collection back to it's
uninitialized lazy state, or is there a way to circumvent this problem
all together? 

Any input, suggestions or further discussion anyone would like to
contribute is certainly welcome. 

Regards,


-- 
Clint M. Frederickson <[EMAIL PROTECTED]>


-------------------------------------------------------
This SF.Net email sponsored by Black Hat Briefings & Training.
Attend Black Hat Briefings & Training, Las Vegas July 24-29 - 
digital self defense, top technical experts, no vendor pitches, 
unmatched networking opportunities. Visit www.blackhat.com
_______________________________________________
hibernate-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/hibernate-devel

Reply via email to