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.  [ 2 posts ] 
Author Message
 Post subject: Delete before Insert
PostPosted: Mon Oct 13, 2008 6:48 pm 
Newbie

Joined: Mon Oct 13, 2008 6:43 pm
Posts: 1
1.2

Parent...
<set name="NetworkGroupBudgets" lazy="false" inverse="true" cascade="all-delete-orphan">
<key column="MKT_GROUP_BUDGET_ID"/>
<one-to-many class="NetworkGroupBudgetEntity" />
</set>

Child...
<many-to-one name="GroupBudget" column="MKT_GROUP_BUDGET_ID" not-null="true" lazy ="false" class="blah.GroupBudgetEntity,blah" />


When I delete and add records that have unique constraints in the db, the insert record fires before the delete.

Our translation does not translate an item for delete, and adds a transient item for insert.

Is there a way to force nHibernate to perform all deletes before inserts?


Top
 Profile  
 
 Post subject:
PostPosted: Mon Oct 13, 2008 8:37 pm 
Expert
Expert

Joined: Mon Nov 26, 2007 2:29 pm
Posts: 443
flush the session immediately after the delete, before inserting.

_________________
Gonzalo Díaz


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

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.