LockNotGranted Exception

Thread is closed for posting
2 posts, 0 answers
  1. Thomas
    Thomas avatar
    9 posts
    Member since:
    Sep 2008

    Posted 25 Jan 2010 Link to this post

    I am getting reports from users of our software which all state the following error:


    Telerik.OpenAccess.Exceptions.LockNotGrantedException: Insert of '~~~~' failed:  
    Das Timeout für Sperranforderung wurde überschritten. 

    We use the default timeout for locks which is 5 seconds.

    This is my question: Does OpenAccess lock tables for reading access? If so, can I modify this behavior?

  2. Jan Blessenohl
    Jan Blessenohl avatar
    707 posts

    Posted 26 Jan 2010 Link to this post

    Hi Thomas,
    If you do not use pessimistic concurrency control the locks should only occur during commit. If you have some bigger commits that uses more than 5 seconds, can also happen because the server has some load, you might see lock timeouts.
    There are two other situations where a row might be locked, one is transaction.flush(), this flushes all changes to the server and keep the server txn open (similar to IgnoreUncommitted = false setting at the query).  The other situation is a GetObjectId() call on a new object with autoinc key generator setting. Here we also flush the insert statement which might result in blocking insert statements form other scopes.

    Sincerely yours,
    Jan Blessenohl
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Back to Top