Thanks for the update @inok_spb, that's quit helpful.
Looking at the code, I think I could see how that could happen. The code isn't very pretty and it's a bit complex. Unfortunately, it's not simple to reproduce (for me), and the issue is low priority since no one else has reported (except just single free-edition user).
However, if you can modify the stored procedures, then I can give you some pointers on what I would do to investigate. If you can fix the stored procedure on your server, then we can modify our source code, and the issue will be resolved!
The first thing I would do is modify DockerImages_SetData
as follows by moving the following line of code to the top of the code block, right below the BEGIN TRANSACTION
statement:
DELETE [DockerImageLayers] WITH (TABLOCKX)
WHERE [DockerImage_Id] = @DockerImage_Id
I don't think a TABLOCKX
is appropriate here, but regardless -- moving this to the top should block DockerImages_GetImage
until the procedure finishes. I don't see any other side-effects from making this change.
If you have someone who is really skilled in SQL Server, then I'm sure they could do a better job than I would, but this is where I would start.
But please try this and let me know!