SCJP, SCJD.
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
SCJP, SCJD.
The way I looked at it was that when the server is to be shutdown, we need to make sure no client user has a lock on any of the records. Therefore the server will issue the lock(-1) to get everyone out, and no longer allow locking by clients, then it can call close, and therefore the server and database are no longer running,
A thread trying to lock the entire database is blocked if the database is locked or one or more records in the table is locked by some other thread.
because record 11 is locked by client B, but client B blocks trying to lock record 1...
Don't get me started about those stupid light bulbs. |