hi all,
i'm trying to gather some more information about session.replicate(). i'm trying to deprecate some old replication stuff i've written in the past and want to replace it with session.replicate().
i use many-to-one mappings quite often. the way i tried to use session.replicate() i either ran into the problem that hibernate told me that the object/collection was already associated with another session (the source session) or the session was closed (trying to lazy-load the collection after i closed the source). i don't need to replicate the collections, only attributes/mapping-id's because the way i prepare the objects that need to be replicated, all the objects from the collections would have been copied before the object that contains the collection. changing lazy-loading to something different also seems not a good way for me as the collections can get quite big and elements in the collection don't change too often. so i guess, i would create too much traffic that way.
is it possible to only replicate a given object and forget about associated objects?
i'm using 2.1.3.
cascade is set to "none" for all mappings.
if you need more info to answer my question pls ask. i read the forum and tried to peek into the source as well. from SessionImpl.doReplicate() i got the impression that if i don't cascade, the above should be possible.
tia jan
|