-->
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: cascade="all-delete-orphan" is throwing error
PostPosted: Thu Oct 22, 2009 1:16 pm 
Newbie

Joined: Thu Oct 22, 2009 1:07 pm
Posts: 2
Hi All,
I have a Main Entity,SubEntity relation in my hbm file. where subEntity has one-to-many relation with main Entity.

i hv declared as <set
name="SubEntity"
lazy="true"
inverse="true"
cascade="all-delete-orphan"
> in my hbm file.

While saving the Main Entity, i m facing an exception called ORA-00001: unique constraint violated.
When i debug and check, the Hibernate is not removing the Old Entries in SubEntity table, instead trying to insert a duplicate record.

I have used Collection.clear() to clear old values and used the same Collection to add new Entries. but even i m getting the same problem

Can any one help me reg this..

Thanks in advance


Top
 Profile  
 
 Post subject: Re: cascade="all-delete-orphan" is throwing error
PostPosted: Fri Oct 23, 2009 10:00 am 
Newbie

Joined: Thu Oct 22, 2009 1:07 pm
Posts: 2
Hi All,
The problem has been solved :)
i used getSession.flush() which solves the problem....

Thanks


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.