-->
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: Is this the intended behaviour of session.replicate()
PostPosted: Thu May 20, 2004 8:09 am 
Regular
Regular

Joined: Thu Nov 20, 2003 10:04 pm
Posts: 64
Location: Melbourne, Australia
I've been using session replicate which seems to work wonderfully in most scenarios but I have an issue with it in one particular scenario.

If I have Class A and Class B that have many-to-one references to each other I can get a problem where integrity contrains are violated. If I were to insert these objects using more normal methods I would do something like:

Code:
session.save(a);
session.save(b);
b.refToA = a;
session.flush();


In otherwords I do the insert then the do an update.

Unfortunately in this case I need to use replicate. Replicate doesn't seem's to just want to do the full inserts (triggering the constraint). I'm wondering whether this is the intended behaviour? I'm basically after something that would detect this situation and automatically do the two stage insert then update.

The reason I'm using session.replicate() is because I'm using the ReverseXMLDatabinder code that's been posted to JIRA. This code works pretty well except for this one issue.


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.