• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Do I have to guarantee this?

 
Aruna Raghavan
Ranch Hand
Posts: 194
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Once the search results are displayed on the gui, do i have to guarantee that the tickets are still available? Or is it acceptable to fail the request when a purchase button is pressed?
In the search case, I just read the data from the server. Once a row is selected and a purchase request is made, I lock the record and then proceed to check if the tickets are still available. If they are, I reduce the count in DB and unlock.
Thanks,
Aruna.
 
Peter den Haan
author
Ranch Hand
Posts: 3252
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Aruna Raghavan:
Once the search results are displayed on the gui, do i have to guarantee that the tickets are still available? Or is it acceptable to fail the request when a purchase button is pressed?
Well, you are the requirements analyst dude on this project. Think.
There are broadly three ways you could guarantee ticket availability. The first is to lock all records displayed, which would make your application unusable. The second is to devise a notification scheme whereby the database notifies clients of changes in the data, which you are explicitly told not to do. The third and final option would be for the application to poll the database every second or so, which, erm, doesn't sound exactly scalable unless you start doing very fancy stuff in the database which you're also asked not to do.
- Peter
 
Aruna Raghavan
Ranch Hand
Posts: 194
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Peter,
I get the message.
thanks.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic