Multiple/Recursive locks are not allowed error (IMediaService.Save)
l

Luuk Peters (ProudNerds)

4 months ago
Ah yes, Umbraco scoping... I need some help with this one. I simply do not know how to fix this and it's just all trial and error. I think the issue is that there are too many action performed on the database, but what I'm doing doesn't seem so special or difficult. This is Umbracoi 13(.5.2) by the way. First in short the main flow before I give some code: In multiple packages, the following happens: - Package B (Umbraco NuGet package) contains a webhook and receives a post with some data (JSON) - Package B passes the data to Package A (non-Umbraco package) to handle and A create a nice deserialized model of it and invokes an event. - Package B (Umbraco package) listens to the event and when it fires, Package B creates a Media node in Umbraco and puts a file and some meta data in there. - Package B also has a custom Umbraco notification it fires, so that consumers of the package can do some custom action if required. These steps al seem to work all the time. Now in an Umbraco instance, the following happens: - Umbraco handles the custom notification that contains a reference to the media item - Umbraco updates a few fields on the media item and then saves it. This is the step that goes sometimes wrong. Possible issues might be that there are more than 1000 webhook posts done too fast. It could also be a combination of async an non-async stuff. Or I shouldn't give a reference to the media node itself in the notification perhaps. Any ideas? I'll create another post with some minimal and simplified code.