Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

URLyBird: about how to deal with the situation book a record(booked)

 
Ronggen Liu
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi guys,

how do you handle the scenario when the user book a record, wihich had been booked by the other user.

my solution is to define a checked exception BookFailedException, and throw it in business method bookRecord.

and handle this in client by getting the root cause of the excepiton, and raise a alert window to show the right information to the user.

what do you guys think about it?

Thank you!
Ronggen
 
Chih-Wei Lee
Ranch Hand
Posts: 129
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi:
I have the similar solution for this issue.
I also define a custom exception to throw if the scenario occurs but
I throw this exception in my database implementation.
 
Happiness is not a goal ... it's a by-product of a life well lived - Eleanor Roosevelt. Tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!