Thanks for your answer Mike.

On Mon, Jul 7, 2014 at 6:39 PM, Michael Blakeley <[email protected]> wrote:

> Locking is done by URI.
>
> Your code looks like it's thinking of the jobs.xml file as if it were a
> large table. Don't do that. Instead think of each document as a row. Then
> you won't need fragment roots either.
>
> -- Mike
>
> On 7 Jul 2014, at 13:05 , Sudheer Yalaverthi <[email protected]>
> wrote:
>
> > Hi,
> >
> >
> > I have a document with below structure. and it is saved under URI
> '/{runlevel}/{userid}/jobs.xml'
> >
> > <joblist>
> >      <job>
> >             <id>1</id>
> >             .
> >             .
> >      </job>
> >      <job>
> >              <id>2</id>
> >              .
> >              .
> >       </job>
> >       .
> >       .
> > </joblist>
> >
> >
> > Each job element is a fragment as I have fragment root defined for the
> Job element.
> > I am retrieving specific job element using cts:search and then trying to
> update the element.
> >
> > let $job := cts:search(/joblist/job,
> cts:and-query(cts:document-query('/runlevel/userid/jobs.xml'),
> cts:element-range-query(xs:QName('id'), '=', '1'))))
> >
> > return if($job)
> >           then xdmp:node-replace($node, element job {....})
> >           else ()
> >
> > My question is does the above query locks the entire document under URI
>  '/{runlevel}/{userid}/jobs.xml' or does it specifically lock the fragment
> that is picked in the search query?
> >
> >
> >
> > Thanks,
> > Sudheer Yalaverthi
> > _______________________________________________
> > General mailing list
> > [email protected]
> > http://developer.marklogic.com/mailman/listinfo/general
>
> _______________________________________________
> General mailing list
> [email protected]
> http://developer.marklogic.com/mailman/listinfo/general
>



-- 
Thanks,
Sudheer Yalaverthi
_______________________________________________
General mailing list
[email protected]
http://developer.marklogic.com/mailman/listinfo/general

Reply via email to