• 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

Do I have to guarantee this?

 
Ranch Hand
Posts: 194
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
author
Posts: 3252
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Peter,
I get the message.
thanks.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic