-->
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.  [ 4 posts ] 
Author Message
 Post subject: handling duplicate key in a database independent manner?
PostPosted: Sat Mar 20, 2004 11:45 am 
Newbie

Joined: Sat Mar 06, 2004 3:55 pm
Posts: 3
With hibernate is there any way to handle duplicate keys without getting database specific. Right now, the only way is to get the SqlException database specific error code . or check for duplicates before inserting which will result in multiple round trips.
thanks -sudhir


Top
 Profile  
 
 Post subject:
PostPosted: Sat Mar 20, 2004 11:51 am 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
Use surrogate keys.

_________________
JAVA PERSISTENCE WITH HIBERNATE
http://jpwh.org
Get the book, training, and consulting for your Hibernate team.


Top
 Profile  
 
 Post subject:
PostPosted: Sat Mar 20, 2004 12:02 pm 
Newbie

Joined: Sat Mar 06, 2004 3:55 pm
Posts: 3
im sorry i didnt make myself clear.
i mean duplicate key exception..
if i have a unique key, and during insertion if it generates a duplicate key exception, is there a database independent way of doing it.
-sudhir


Top
 Profile  
 
 Post subject:
PostPosted: Wed Mar 24, 2004 6:57 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
Unfortunatly no. Search the forum for some discussion on that.

_________________
Emmanuel


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 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.