Hi all,

        I have two xqueries

     xquery# 1. Sleeps for 10 secs (xdmp:sleep) and updates an existing
node with a new value and logs the value "Executing #1".
     xquery# 2. Updates the same node which is being updated in xquery #1
but no sleep and logs the value "Executing #2".


I am executing these in the order #1 first and #2 second via two separate
query console of the same server

I expected the xquery#2 to either wait for 10 seconds (if a write lock is
obtained on the document) or update the node even before the xquery#1 does
it's update, but the output seems to be differing every time, the strange
thing is sometimes the xquery#2 is getting executed twice (Confirmed via
log as well as the updated value in the document) or vice versa.

PFB the xqueries and xml used

*xquery#1*

xdmp:sleep(10000),

xdmp:node-replace(doc("book.xml")/catalog/book[1]/price,<price>0003</price>),

xdmp:sleep(10000),

xdmp:log("Executing #1"),

doc("book.xml")/catalog/book[1]/price





*xquery#2 *


xdmp:sleep(10000),

xdmp:node-replace(doc("book.xml")/catalog/book[1]/price,<price>4445</price>),

xdmp:sleep(10000),

xdmp:log("Executing #2"),

doc("book.xml")/catalog/book[1]/price


*Sample xml*

<catalog>
<book id="bk101">
  <author>Gambardella, Matthew</author>
<title>XML Developer's Guide</title>
<genre>Computer</genre>
<price>0004</price>
<publish_date>2000-10-01</publish_date>
<description>An in-depth look at creating applications with
XML.</description>
</book>
</catalog>

I'm using Marklogic version 7.0-2.3, I'm unable to figure out a pattern.
Can someone explain this behavior?


Thanks!
Raghu
_______________________________________________
General mailing list
[email protected]
http://developer.marklogic.com/mailman/listinfo/general

Reply via email to