Hi All,
We are facing an issue while using xdmp:lock-for-update to implement the below
use case. We are able to reproduce this issue only in a clustered environment.
Use case:
There is a limitation to be set on the number of items a user can store.
Whenever a user tries to insert a document, before actual insertion, the user
directory is locked using xdmp:lock-for-update and item count is checked. if
the count does not reach the limit then the document is inserted.
Lock mechanism is used as the item count needs to limited to a specified number
even when there are concurrent insert request from an user.
Eg. /{environment}/{userid}/{itemid}.xml
Error details:
We are getting the below exception when there are concurrent requests,
Exception encountered - throwing com.marklogic.xcc.exceptions.XQueryException:
SVC-EXTIME: xdmp:lock-for-update (user directory)-- Time limit exceeded
If the above exception is unnoticed, it leads to this,
Exception encountered - throwing com.marklogic.xcc.exceptions.XQueryException:
XDMP-DEADLOCK: xdmp:lock-for-update(user directory) -- Deadlock detected
locking ForestName ForestID
Please let us know if we are missing anything here.
_______________________________________________
General mailing list
[email protected]
http://developer.marklogic.com/mailman/listinfo/general