• 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 ...
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
  • Mikalai Zaikin

blocking a ticket while booking it thru online in website

Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Friends,

I had an interview sterday. interviewer asked me a question.
A person "A" books a fligth ticket form 7 steps. while he goes to the first step, he got a message saying one seat is available. he has entered from step 1 till 7 giving his credit card details and all. the question is at the same time if another person "B" with high internet speed conn is trying to book the same ticket. that should be avoided. as soon as the person "A" starts the step 1 till he completes all the steps , none of them shud be able to access the ticket. it should be bocked by the person "A".

my answer was locking the transation from step 1to step7 at the database level. is that correct.

Can any one suggest me with the proper answer.
Ranch Hand
Posts: 249
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Locking the transaction will only give integrity to the process, but not necessarily the integrity to ticket count remaining. You answered it correctly, but I guess we can add a bit more of information to press the result

What I am thinking is like a temporary buffer - The moment someone passes the step1 (I guess thats where the seat availability check is done), decrement the ticket counter by one, and add one ticket to the in-process buffer (the temporary buffer, I mentioned before) - This ensures that the ticket will be available if the user successfully competes the transaction, no matter what the speed of his connection is. If the transaction fails or is aborted for some reason, you need to do the reverse of the initial process (reduce one ticket from in-process, and add one to the available... and so on)
Don't get me started about those stupid light bulbs.
    Bookmark Topic Watch Topic
  • New Topic