Hi,
I have two contexts c1 and c2, each mapping one database, repsectively Production and Archiving.
I "find" entity in Production : c1.find*
and persist them in Archiving. : c2.persist*
and the found entities gets detached from c1. Why?
shouldn't they get detached for c2 and stay NOT detached in c1?
See, if I want to make an extra action by removing the found entities from Production I have to merge the found entities again in c1 before I can remove them from c2 : c1.merge*
this is extremely expensive in performance (because it is equivalent to one select per found entity).
So, what should I do to avoid merging?
|