Shared vs. Exclusive Lock Queuing
It is important to note that if a shared lock is already held by a session, then an EXCLUSIVE lock is made to wait, that new requests for shared locks will wait until the exclusive lock has been granted.
I use this in a stock system where processes who want a "rough" number e.g. for reports request a shared lock. But processes that need an exact figure, or need to update the stock numbers request an exclusive lock.
Click on read more to see sample code and the testing procedure.
Click on read more to see sample code and the testing procedure.
