Hi shao,
First of all you will need to change your display name to a first and last name if you want to continue getting the best
Java help anywhere on the www.
A write lock simply means that while one client is in the process of modifying a particular record, any other client may read that record without constraint.
Why not the sequence is "read, modify, lock, write, unlock"
Well, what happens if two (or fifteen) clients perform this sequence at the same time? You have a race condition which will almost certainly result in the corruption of that record. Say that there were only one seat available and three clients read the record before any modify. All three clients would believe that they had sucessfully booked the flight after modification. You would have three very angry customers when they showed up at the airport and found out there was only one seat available.
Hope this helps,
Michael Morris
Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius - and a lot of courage - to move in the opposite direction. - Ernst F. Schumacher