-->
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: Cascade on differents schemas
PostPosted: Tue Jun 19, 2012 11:44 am 
Newbie

Joined: Thu Jun 07, 2012 5:12 am
Posts: 3
Hello, we have an application with links between entities on differents schemas:
Code:
Entity A (from schema 1) -----@OneToMany(cascade=MERGE)----> Entity B (from schema 2).


Sometimes we have a problem with cascade type merge when Merging A in this case:

Code:
A = getAbyId(id)
A.setB( new B() )
merge(A)


Code:
object references an unsaved transient instance – save the transient instance before flushing

this error refers object B as the unsaved entity.

I thought that with cascade TYPE = Merge, it should handle in the right order the save of B then A.

Should we handle this manually?

thank you


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.