Bilal, I can release locks without a problem.
(: Q1 :)
doc('test.xml')
=> <x><a id="1"/></x>
(: Q2 :)
xdmp:lock-acquire(
"test.xml", "exclusive", "0",
"document being updated", xs:unsignedLong(600))
=> ()
(: Q3 :)
xdmp:lock-release('test.xml')
=> ()
Perhaps you are trying to acquire and release the same lock in the same
query? That is indeed a conflicting update, because you are updating the
same lock in the same way within the same transaction.
Have you read chapter 4 of the Developer's Guide? It discusses some important concepts behind MarkLogic Server transactions.
http://developer.marklogic.com/pubs/Note that you may not need to lock the document at all. If you're simply updating a document, the server will automatically obtain a write-lock for your query's transaction. When the query completes, the transaction automatically commits and also releases the lock.
If you are implementing CMS-like functionality, and checking the document out with a persistent lock, then you must rethink your query logic. You will only be able to change the state of the lock once within a given query. So find a way to either lock or not lock the document, once and for all.
-- Mike Bilal Khalid wrote:
Hello,
If a document lock is acquired with a time-limit (e.g. xdmp:lock-acquire("
mydocument.xml", "exclusive", "0", "document being updated",
xs:unsignedLong(600))), is it possible to release said lock using the
xdmp:lock-release() function before the specified time limit expires? I get
XDMP-CONFLICTINGUPDATES errors when I attempt that.
-Bilal
------------------------------------------------------------------------
_______________________________________________
General mailing list
[email protected]
http://xqzone.com/mailman/listinfo/general
smime.p7s
Description: S/MIME Cryptographic Signature
_______________________________________________ General mailing list [email protected] http://xqzone.com/mailman/listinfo/general
