-->
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: Persisting cause duplicate key exception
PostPosted: Thu May 24, 2012 11:40 pm 
Newbie

Joined: Thu Dec 08, 2011 11:31 pm
Posts: 3
Hi all,

I have a table CN with primary key CN_NO. CN has one to many relationships with table CN_CLOS (which primary key is combination of CN_NO and CLOS_NO).

Program flow is like this:

Create CN_CLOS
Set CN.SETCNCLOS(CNCLOS); -- set CN_CLOS to CN without persisting CN_CLOS first
Persist CN (cascade type is Persist and Remove)
Flush

In many incidents i could see in the logs DuplicateKeyException on persisiting and the table involved is CN_CLOS. Please advice. Thank you very much.


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.