I have a requirement where a web service is called to generate the next number in a list.
There are multiple clients and I don't want to lock the whole table just the record for the client I am getting the next number for. Each client has their own numbering system.
However, I need the table to be locked on read of the particular record so that I can generate the new number, save it and return it.
I was thinking of loading the whole list into memory, making changes there and then simple using enqueue and dequeue to stack the requests but this is not client centric. Shouldn't be an issue at the end of the day as requests will be low.
We are using Entity Framework and LINQ for data access.
I guess what I'm asking is what approaches you might use for locking on read as the main question.