Hi,
I started working on URLyBird 1.2.1 and have read this thread. I seem to have a quite different view of the locking mechanism than most of you, or maybe I just haven't spent enough time on the documentation
. Some people even says the lockCookie is a stupid requirement doesn't seem stupid at all if you look at the problem in another way.
The common solution here seems to lock a record directly before updates/deletes. Here's my view of the locking:
1. Client1 wants to book a record. Client1 selects a record for update. So the lock is set on the selected record before he starts updating the row.
2. Client2 selects the same record for update, but gets a notification that this record is locked. Client2 understands the situation.
3. Client1 klicks 'book record' after he has modified the data. Now the real update occurs, and the lock is unlocked directly after the real update.
Here's another check that should be added too(using some common sense):
4. Client3 comes in after Client1 has made the update. Client3 selects the same record for update. Since the record has a client id in the "owner"-field (from Client1s update), he will be notified that the record is already booked.
Makes any sense?