|
This is becoming really tricky. When I detach the object from the session,
I can’t access the rest of the objects in the graph, since they may not
have been loaded (Lazy loading). I tried cloning as I traverse the non-detached
object graph, making sure to change the IDs of the clones and not the original,
and it appeared to be working, then I got an OutOfMemory error. *DOH* A solution must be close… From: Yeah, you have to detach,
or it maintains extra data in the CGLIB-constructed objects that tell it that
the object has an identity in the database. On 5/4/06, Enrico
Goosen <[EMAIL PROTECTED]>
wrote: The plot thickens… Is it really necessary to detach the object graph from the
session? I'm using the session-per-conversation pattern (long
conversation), because my Swing gui application doesn't work well Hibernate
session-per-request pattern. Setting the IDs to null is also a problem, because I'm using
long (primitive type) for the IDs. When I set the ID to -1, I get a NonUniqueObjectException. What to do…what to do… From: [email protected]
[mailto:[email protected]]
On Behalf Of Noel Grandin Hmmm, detaching the object will make it "new"
from hibernate's point of view. On
5/4/06, Enrico Goosen < [EMAIL PROTECTED]>
wrote: Is
it possible to clone and persist
an object graph in Hibernate? I've come across the org.hibernate.util.SerializationHelper which can be used to clone an object graph, but I don't think that it can be persisted, since its id's will be the same as the original object graph.
--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "CTJUG Forum" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/CTJUG-Forum -~----------~----~----~----~------~----~------~--~--- |
- [CTJUG Forum] Hibernate guru's Enrico Goosen
- [CTJUG Forum] Re: Hibernate guru's Noel Grandin
- [CTJUG Forum] Re: Hibernate guru's Enrico Goosen
- [CTJUG Forum] Re: Hibernate guru's Noel Grandin
- [CTJUG Forum] Re: Hibernate guru's Enrico Goosen
- [CTJUG Forum] Re: Hibernate guru's Bruce Stewart
- [CTJUG Forum] Re: Hibernate guru's Noel Grandin
- [CTJUG Forum] Re: Hibernate guru's Enrico Goosen
- [CTJUG Forum] Re: Hibernate guru's Bruce Stewart
