• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

What condition throw DuplicateKeyException?

 
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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!
 
Ranch Hand
Posts: 222
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 56
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 172
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic