• 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

no claimers for this one...very sad....

 
Ranch Hand
Posts: 263
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi all,
what is the optimum time to lock a record in seconds. and when exactly i have to lock it.
for example my client is having a checkbox called
reserve and a book button .
i will lock the record as soon ad the reserve checkbox is clicked. but what if he is going for the book button before cliking the reserve button . i will check if " not already locked, lock it".
but in this case he may not get his tickets if someone has already locked. how to handle this .
in general how long shall i wait for the lock ???
any suggestions on this will be a great help .
regards,
aadhi
[ January 23, 2003: Message edited by: aadhi agathi ]
 
Ranch Hand
Posts: 2937
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


for example my client is having a checkbox called
reserve and a book button .


You are making it too complex, -- you don't need a "reserve" button.
Eugene.
 
aadhi agathi
Ranch Hand
Posts: 263
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi,
can some one give me a brief on the flow of the lock and booking/cancel activities. does it required that the user needs to perform a lock function, can take his/her own cool time before going for a reserve/cancel action. 2)or the lock will be formed just prior(no lock holding for long) to the user making a reserve/cancel action.
it can be anything but not option2, reason that all the talk of food,fork and lockmanager need to move to the trash...
any help will spare me a heart break!!

-Aadhi
[ January 22, 2003: Message edited by: aadhi agathi ]
 
author
Posts: 11962
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You don't need to implement a "reservation" scheme. Plain booking is enough (the state goes from "not booked" directly to "booked" without any intermediate phases).
The locking functionality is required for data integrity, not for some kind of reservation feature.
While the user browses through a list of flights and decides the one he's willing to book, some other users may have booked all remaining seats -- and the screen is still showing that there remains seats available. That is why upon booking, the client application should first lock the flight record, read the up-to-date amount of available seats, and then continue with booking if enough flights are still left. After all this, the record lock is to be released so that other client applications can book seats on that flight.
 
aadhi agathi
Ranch Hand
Posts: 263
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Lasse Koskela:
You don't need to implement a "reservation" scheme. Plain booking is enough (the state goes from "not booked" directly to "booked" without any intermediate phases).


this is too clear

Originally posted by Lasse Koskela:

The locking functionality is required for data integrity, not for some kind of reservation feature.


could you please eloborate on this. i am guessing that we dont want to throw an error in the modify method if the requested seats are not available which can be done to maintain the data integrity.
Ofcourse,thanks for the help
regards,
-Aadhi
[ January 23, 2003: Message edited by: aadhi agathi ]
 
author
Posts: 3252
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
There is no book() method on the server. Just methods to lock, read, modify, and unlock records.
Other clients may be booking seats behind your back, while the user is still deciding how many seats (s)he wants to book. So until the moment that you actually execute the seat booking code, you are not quite sure whether the booking can be satisfied or not.
While doing the final check that enough seats are available, you must prevent other clients from modifying the number of seats. If you don't, then a race condition could lead to double-booking seats.
Have a think...
- Peter
 
aadhi agathi
Ranch Hand
Posts: 263
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
locking issue a classic discussion
thanks a lot Peter, luck would have it, i was going thr' the above link where you are one of the key players. Amazing! . no more no less.
regards,
-Aadhi
[ January 24, 2003: Message edited by: aadhi agathi ]
 
Can you shoot lasers out of your eyes? Don't look at this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic