I have a dev question related to concurrency. Here's the problem:
I need to generate a sequential reference number for each document uploaded to a specific document library. The numbers basicaly look like this:
DocumentFooX12 - Sequence Number: 2014-0001 DocumentWhatever2a - Sequence Number: 2014-0002
Now this typically is not difficult to do with an Event Receiver and I have no problem writing the code. The problem though is related to concurrency.
We have a multi server farm and use Network Load Balancing. Whenever two people work at the same time, they might be working on different servers. I cannot guarantee that the numbers will really be sequential.I've tried a Lock Object in my event receiver but that doesn't make a difference because it only locks the thread on Server1, but not server 2.
Has anyone done some work with the State Service that might help me?
I've also tried a Timer Job, but the requirement dictates that the sequence number is generated almost immediately.