I have a stored procedure that should not be called twice at the same time by
different processes.
The procedure operates a sort of semaphore lock by finding a record and updating
a flag on the record to ensure that no other client retreives the same record. I
have tried SET TRANSACTION ISOLATION LEVEL SERIALIZABLE, but this appears to
allow secondary processes to retrieve the record even while it is being updated
by the initial process.
Is there a way to ensure that multiple calls to the same stored procedure run
sequentially rather than simultaneously?