Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Karl Mogensen 4 posts 74 karma points
    Jun 07, 2022 @ 23:31
    Karl Mogensen
    0

    Getting "System.Data.SqlClient.SqlException: : 'Lock request time out period exceeded'" On all delete operations

    After running an Umbraco application as an azure app service with a couple of api endpoints added through a custom package we are now facing the issue of not being able to delete content nodes at all. Neither programmatically calling the contentservice method "DeleteContent" Nor using the "delete" button in backoffice for content that is in the recycle bin. Both operations cause the following exception to occur: "System.Data.SqlClient.SqlException: : 'Lock request time out period exceeded'". From my research of this exception i have reached the conclusion that it is caused by application code, rather than the sql server itself being the cause of the issue. Is there any way for me to configure the "Lock request timeout" of the Umbraco application?

    • The custom api endpoints that have been called with some frequency contains transaction heavy operations with multiple publishes as well as deletes of contents. I believe this to be the origin of the issue, however this has now caused the entire application to be unable to handle manual operations such as deleting a single content node

    • The sql server is hosted as an azure sql server

  • Dave Woestenborghs 3504 posts 12135 karma points MVP 9x admin c-trib
    Jun 08, 2022 @ 06:52
    Dave Woestenborghs
    0

    Hi Karl,

    Maybe you can post the code that is modifying the content. That way we can see if something is wrong there.

    Dave

  • Karl Mogensen 4 posts 74 karma points
    Jun 08, 2022 @ 08:39
    Karl Mogensen
    0

    Hey Dave, sure:

        public class CustomService
    {
        private readonly IContentService contentService;
        private readonly IScopeProvider scoper;
        public CustomService(IContentService contentService, IScopeProvider scoper)
        {
            this.contentService = contentService;
            this.scoper = scoper;
        }
    
        public void Do(Work work)
        {
            using (var scope = scoper.CreateScope(IsolationLevel.ReadCommitted))
            {
                DeleteSomeNodes(work);
                CreateAndPublishSomeNodes(work);
                scope.Complete();
            }
        }
    
  • Karl Mogensen 4 posts 74 karma points
    Jun 08, 2022 @ 08:42
    Karl Mogensen
    0

    Btw today i get the "lock request timeout" exception when i debug and run the project locally, no custom code called and this error occurs prior to the frontpage even loading

  • Karl Mogensen 4 posts 74 karma points
    Jun 11, 2022 @ 14:17
    Karl Mogensen
    0

    I solved the problem by reexamining the functionality i was trying to achieve, and determined that it was not neccessary for me to do one atomical transaction for all my changes. I removed the scope and instead relied upon the transactions handled internally by the service class.

Please Sign in or register to post replies

Write your reply to:

Draft