Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

What condition throw DuplicateKeyException?

 
Along huang
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,my assignment is URLybird.

Are the key name field and location field? if sure, a hotel only have a room in this database, it seem to deviate the social truth.

I can't decide the design yet, please anyone get me a idea.

best regards!
 
HaoZhe Xu
Ranch Hand
Posts: 222
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I met the same problem when i was doing the project, my understanding may be wrong: it may be thrown when you creating a new record, the instructions told you that you can reuse a deleted one if available, in this case, a DuplicateKeyException will be thrown. if there's no deleted record, you have to create a new one at the back of the file, so this exception will not be thrown.
I think you understand what i am talking about...forgive my poor English
 
Jan Rotthaus
Ranch Hand
Posts: 56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi!

I have the B&S assignment, but the data interface is very similar. I decided, that because there is no key, no DuplicateKeyException can be thrown. But that's just my decision, if something else makes more sense to you, do it that way. Just remember to document your decision in your "choices.txt"!

Jan
 
Robert Konigsberg
Ranch Hand
Posts: 172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think there are no conditions to throw DuplicateKeyExceptions.

So I don't throw DuplicateKeyException, and in my documentation I explain that.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic