Copied to clipboard

Flag this post as spam?

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


  • Heather Floyd 610 posts 1033 karma points MVP 6x c-trib
    Mar 27, 2020 @ 04:32
    Heather Floyd
    0

    "System.Data.SqlServerCe.SqlCeLockTimeoutException: SQL Server Compact timed out waiting for a lock." when editing Member

    I have some code which deals with creating and updating Members. For reasons out-of-scope of this issue, the code which creates a member (using an Umbraco Forms Custom Workflow) passes the MemberId and other info to another function which is in a WebApi, by POST. The WebApi uses the MembershipService to get an instance of the member just created and set some additional property data, then saves the member.

    When I run this locally using SQLCE DB, the WebApi code always fails with "System.Data.SqlServerCe.SqlCeLockTimeoutException (0x80004005): SQL Server Compact timed out waiting for a lock."

    It seems that the initial code is somehow locking that single new Member record, but I'm not sure how to "unlock" it after I save the member, and before I call the WebApi...

    This is the full error:

    System.Data.SqlServerCe.SqlCeLockTimeoutException (0x80004005): SQL Server Compact timed out waiting for a lock. The default lock time is 2000ms for devices and 5000ms for desktops. The default lock timeout can be increased in the connection string using the ssce: default lock timeout property. [ Session id = 2,Thread id = 40656,Process id = 36024,Table name = umbracoLock,Conflict type = s lock (x blocks),Resource = RID: 1189:6 ]
       at System.Data.SqlServerCe.SqlCeDataReader.ProcessResults(Int32 hr)
       at System.Data.SqlServerCe.SqlCeDataReader.IsEndOfRowset(Int32 hr)
       at System.Data.SqlServerCe.SqlCeDataReader.Move(DIRECTION direction)
       at System.Data.SqlServerCe.SqlCeDataReader.Read()
       at System.Data.SqlServerCe.SqlCeCommand.ExecuteScalar()
       at Umbraco.Core.Persistence.FaultHandling.RetryPolicy.ExecuteAction[TResult](Func`1 func)
       at NPoco.Database.ExecuteScalarHelper(DbCommand cmd)
       at NPoco.Database.ExecuteScalar[T](String sql, CommandType commandType, Object[] args)
       at Umbraco.Core.Persistence.SqlSyntax.SqlCeSyntaxProvider.ReadLock(IDatabase db, Int32[] lockIds)
       at Umbraco.Core.Services.Implement.MemberService.GetById(Int32 id)
    

    Does anyone have ideas about how to handle this?

    Thanks!

  • Rune Grønkjær 1372 posts 3103 karma points
    Mar 31, 2021 @ 13:00
    Rune Grønkjær
    0

    +1

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies