-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: I know "detached entity", but with 2 contexts?
PostPosted: Wed Mar 18, 2009 2:45 am 
Newbie

Joined: Fri Feb 06, 2009 2:16 am
Posts: 8
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?


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.