locked
Cache Preview - DataCacheException ErrorCode<ERRCA0012> RRS feed

  • Question

  • Hello Everyone!

    I have been using the Cache preview for session state and it is working very well on the whole. However, I am getting occasional errors (as below)

    Microsoft.ApplicationServer.Caching.DataCacheException ErrorCode<ERRCA0012>:SubStatus<ES0001>:Object being referred to is not locked by any client.

    Can anyone shed any light on this error. 

    Thanks,

    Paul.

    Thursday, October 24, 2013 6:12 PM

Answers

  • Hi Paul,

    Thanks for posting!

    Here is a good solution, I guess it may help you:

    If you are using lock related APIs, please ensure you are handling exceptions such as ObjectLocked ( and ObjectNotLocked (Object being referred to is not locked by any client) error.

    GetAndLock can fail with “<ERRCA0011>:SubStatus<ES0001>:Object being referred to is currently locked, and cannot be accessed until it is unlocked by the locking client. Please retry later.” error if another caller has acquired a lock on the object.

    The code should handle this error and implement an appropriate retry policy.

    PutAndUnlock can fail with “<ERRCA0012>:SubStatus<ES0001>:Object being referred to is not locked by any client” error.

    This typically means that the lock timeout specified when the lock was acquired was not long enough because the application request took longer to process. Hence the lock expired before the call to PutAndUnlock and the cache server returns this error code.

    The typical fix here is to both review your request processing time as well as set a higher lock timeout when acquiring a lock.

    You can also run into this error when using the session state provider for cache. If you are running into this error from session state provider, the typical solution is to set a higher executionTimeout for your web app.

    Also, You could see this blog to  get more detail (http://blogs.msdn.com/b/jagan_peri/archive/2012/09/09/best-practices-for-using-windows-azure-cache-windows-server-appfabric-cache.aspx).

    Thanks

    Regards,

    Will


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Friday, October 25, 2013 6:42 AM