Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

my two cents on duplicateKey Exception

 
Andy Zhu
Ranch Hand
Posts: 145
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This has been discussed extensively on the forum. There are three alternative "solutions" (see link below). noneis convencing, since sun doesn't say anything about this ex and these solutions made assumptions to some degree. I try to make less assumption: if passed-in data are all null, then I am sure I won't create it in db and I throw the ex. No other case will throw an ex. I think this assumption is standable. Any comments.


http://www.coderanch.com/t/184254/java-developer-SCJD/certification/DuplicateKeyException

http://www.coderanch.com/t/183894/java-developer-SCJD/certification/NX-Duplicate-Key-when-updating

http://www.coderanch.com/t/183817/java-developer-SCJD/certification/Nx-Documenting-DuplicateKeyException
 
Andy Zhu
Ranch Hand
Posts: 145
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
or the case that the arg has more or less fields than the db.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic