Assume I have 3 different classes, A
, B
& C
. C
is designed to have a list of A
s and B
s.
If load a list of A
s and B
s and keep them attached, how can I set them as lists in a transient C
object and persisting the transient object ?
The problem is that each of A
s and B
s lists are managed by different PersistenceManagers. So if I try to persist a transient C
object with a list of A
s (attached, managed by a PersistenceManager) and a list of B
s (attached, managed by a second PersistenceManager), I'll get an exception saying that the A
s and B
s are being managed by a different PersistenceManager.
Is there an efficient way to resolve this instead of having to reload all the lists again by the one PersistenceManager responsible for persisting the C
object ?