[XQZone General] Anyone used locks ? Strangeness....
Andy Townsend
atownsen at wiley.co.uk
Sat Nov 19 10:05:14 PST 2005
Hi Folks,
Anyone tried using locks in Mark Logic?
I tried a few various things and now see to have a lock that
isn't.... When I try to acquire a lock on a document I get
XDMP-LOCKCONFLICT, so I list the locks on the document and there it appears
to be, so I try to release it and I get told it's not locked -
XDMP-NOTLOCKED. Sample code and output is below.
Also, the timeout does not appear to bedoing anything - created the
original lock with a 60 second timeout and it's still there much later.
Anybody any ideas whats happening?
Thanks
Andy
Platform : Solaris
Version : Mark Logic 3.0-2
Code::
try {
xdmp:lock-acquire("/eot/eot178.xml","exclusive","0","me",xs:unsignedLong(5))
}
catch ($ex)
{
<p>
<qq>EXCEPTION</qq>
<qq>{$ex}</qq>
<qq>{xdmp:document-locks("/eot/eot178.xml")//lock:lock}</qq>
<qq>{try {xdmp:lock-release("/eot/eot178.xml") } catch ($ey) {$ey} }</qq>
</p>
}
Output::
<p>
<qq>EXCEPTION</qq>
<qq>
<err:error xsi:schemaLocation="http://marklogic.com/xdmp/error
error.xsd">
<err:code>XDMP-LOCKCONFLICT</err:code>
<err:message>A conflicting lock exists on this document</err:message>
<err:format-string>XDMP-LOCKCONFLICT:
xdmp:lock-acquire("/eot/eot178.xml", "exclusive", "0", "me",
xs:unsignedLong("5"))
-- A conflicting lock exists on this document
</err:format-string>
<err:retryable>false</err:retryable>
<err:expr>xdmp:lock-acquire("/eot/eot178.xml", "exclusive", "0",
"me", xs:unsignedLong("5"))</err:expr>
<err:data/>
<err:stack>
<err:frame>
<err:line>4</err:line>
</err:frame>
</err:stack>
</err:error>
</qq>
<qq>
<lock:lock>
<lock:lock-type>write</lock:lock-type>
<lock:lock-scope>exclusive</lock:lock-scope>
<lock:active-locks>
<lock:active-lock>
<lock:depth>0</lock:depth>
<lock:owner>me</lock:owner>
<lock:timeout>60</lock:timeout>
<lock:lock-token>http://marklogic.com/xdmp/locks/3a9ba069f6ee2b2c</lock:lock-token>
<lock:timestamp>1132420603</lock:timestamp>
<sec:user-id>13421101198227715383</sec:user-id>
</lock:active-lock>
</lock:active-locks>
</lock:lock>
</qq>
<qq>
<err:error xsi:schemaLocation="http://marklogic.com/xdmp/error
error.xsd">
<err:code>XDMP-NOTLOCKED</err:code>
<err:message>Document not locked</err:message>
<err:format-string>
XDMP-NOTLOCKED: xdmp:lock-release("/eot/eot178.xml") -- Document
not locked
</err:format-string>
<err:retryable>false</err:retryable>
<err:expr>xdmp:lock-release("/eot/eot178.xml")</err:expr>
<err:data/>
<err:stack>
<err:frame>
<err:line>12</err:line>
<err:variables>
<err:variable>
<err:name>ex</err:name>
<err:value>/err:error</err:value>
</err:variable>
</err:variables>
</err:frame>
</err:stack>
</err:error>
</qq>
</p>
######################################################################
The information contained in this e-mail and any subsequent
correspondence is private and confidential and intended solely
for the named recipient(s). If you are not a named recipient,
you must not copy, distribute, or disseminate the information,
open any attachment, or take any action in reliance on it. If you
have received the e-mail in error, please notify the sender and delete
the e-mail.
Any views or opinions expressed in this e-mail are those of the
individual sender, unless otherwise stated. Although this e-mail has
been scanned for viruses you should rely on your own virus check, as
the sender accepts no liability for any damage arising out of any bug
or virus infection.
######################################################################
More information about the General
mailing list