• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

lock..read..modify..unlock

 
Varaku Venkata
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Could somebody explain what does this (lock.read..modify..unlock sequence) actually mean..when a client selects a particular criteria he gets the requested records..when he gets the records means he can read all those records...
so, should I lock all these records or only after selecting a particular record ...
and if I lock record after selecting a record it will be read..lock..modify..unlock sequence...
how to deal with this situation...
[ April 09, 2002: Message edited by: Varaku Venkata ]
 
Siddharth Mehrotra
Ranch Hand
Posts: 185
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
welcome to the lock/unlock loop.
Venkata it is actually a sequence lock.
once you read the data you and show it to the user, till that point it is fine. but after that when u try to book the tickets for the user how do u have the gurantee that the records shown to the user are same and consistent with the database.
so for tha u start a sequence lockin mechanism and read the data and modify it.
i hope i have cleared your doubt
and the information was a descent eye opener for you
 
Varaku Venkata
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
siddhartha,
can u expalain me in detail the flow the user will follow...like when a user clicks on the search button it calls criteriaFind(search string)then it calls methods of Data Class and return the rows of records...similarly what should happen in the JTable....
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
OK, from that point, the user select a flight from the JTable, and now the user wants to book that flight, the user enters the number of seats to book. At this point you lock the record, then you will re-read that record to make sure it hasn't changed and that there are enough seats. If there are then you modify and then unlock the record. If there is not enough seats, then you just unlock, and notify the user of the problem.
Mark
 
Varaku Venkata
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Mark and Siddharth..got the answer ....
I have some more doubts...
1. how many flight reservations should a user book at a time..
2. is there any use of making the table listen to user actions..other than selecting the row for reservation...
3. do we need to capture any user information for booking of tickets (like this client id has booked so many tickets or we just reduce the number of seats..)
Thanks
venkat
[ April 09, 2002: Message edited by: Varaku Venkata ]
 
Siddharth Mehrotra
Ranch Hand
Posts: 185
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
1> how many flight a user should book at a time.( well that depends on how you want to code, i have implemented , so that user can book only one flight at a time) how many tickets in that flight. thats left to the user.
2>No (as per me)
3> Thats beyond teh scope of this project. I ahve catered to just the number of tickets and have reduced them in the database and the clients GUI

--------
hope i'am clear enough
 
Varaku Venkata
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks siddhu ....gave some useful inputs.......
Any other suggestions are welcome
[ April 09, 2002: Message edited by: Varaku Venkata ]
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
2) The only thing that I had different was when they selected a row, it would enable my JTextfield for entering the number of seats. and if the flight they selected did not have any seats left, then it stayed disabled.
Mark
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic