Pradeep,

The commit of all updates from a transaction occurs after the XQuery is done 
running, including the try/catch. So setting the properties did not trigger the 
conflict (or at least it is not detected) inside the try/catch. That code 
completes, then when the system actually processes the transaction commit after 
all code is done, it sees the same fragment being updated in inconsistent ways 
and raises the error.

So you need to look at your program logic to avoid the conflict. Can you 
describe what happens and what you are trying to accomplish at a high level?

Yours,
Damon

--
Damon Feldman
Sr. Principal Consultant, MarkLogic




From: [email protected] 
[mailto:[email protected]] On Behalf Of Pradeep Maddireddy
Sent: Friday, April 19, 2013 10:15 AM
To: General Mark Logic Developer Discussion
Subject: [MarkLogic Dev General] Try Catch Conflicting updates

Hi..!

Try catch doesn't seem to work with conflicting updates problem. I am trying to 
update the same document property in the same transaction so I used try catch 
so that the second update can be ignored but doesn't seem to work. Marklogic is 
still throwing an hard error even when I am using a try catch in the below case.
Is there anything wrong in the below block of code.

My actual situation isn't as straight forward so I cannot use alternate 
approaches.

try {
(
xdmp:document-set-property("/root/abc.xml",<priority>5</priority>),
xdmp:document-set-property("/root/abc.xml",<priority>6</priority>)
)
}
catch($err)
{
  "error"
}

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

Reply via email to