Wednesday, June 11, 2014

ItemUpdating event receiver throwing error - 0x81020015The file has been modified by ...

Few days back I tried to create an event receiver on a SharePoint Library which is going to fire whenever somebody adds a new record. At the time of adding the record the event receiver was supposed to add the logged in users name into a custom column. But to my great amusement it started throwing the following error:

0x81020015The file XXX has been modified by...


Unfortunately I was not able to fix it and after doing a lot of RnD was not able to find a conclusive solution.
It looks like a read/write lock problem and I was not interested in sending a thread to sleep. So I changed my logic a little bit and started implementing the same logic in Item_Updated event. So if you face the same error, then if Googling doesn't help you much, then I will suggest to tweak the logic and use Item_Updated event! Sorry!

No comments:

Post a Comment