[MarkLogic Dev General] Conflicting updates
Danny Sokolsky
Danny.Sokolsky at marklogic.com
Thu Oct 28 10:45:05 PDT 2010
And, at the risk of stating the obvious, if your application requires an update that is conflicting in a single transaction, you can always do it in multiple transactions.
-Danny
From: general-bounces at developer.marklogic.com [mailto:general-bounces at developer.marklogic.com] On Behalf Of semerau at hotmail.com
Sent: Thursday, October 28, 2010 9:52 AM
To: general at developer.marklogic.com
Subject: Re: [MarkLogic Dev General] Conflicting updates
So let me see if I've got this right:
1. Two xdmp:document-insert()s on the same URI -> conflict
2. Two xdmp:node-replace()s on the same doc, same node -> conflict
3. Two xdmp:node-replace()s on the same doc, different nodes -> no conflict
4. Two xdmp:node-insert-after()s on the same node -> conflict (because order would matter?)
5. Two xdmp:document-add-properties()s on the same doc -> conflict
6. Two xdmp:document-set-property()s on the same doc, same property -> conflict
7. Two xdmp:document-set-property()s on the same doc, different properties -> no conflict
8. xdmp:document-insert() and xdmp:document-add-properties() on the same doc -> conflict
I suppose I could just set up a test a run through them all to find out.
________________________________
From: jhunter at marklogic.com
Date: Thu, 28 Oct 2010 08:49:08 -0700
To: general at developer.marklogic.com
Subject: Re: [MarkLogic Dev General] Conflicting updates
Just to clarify, the rule on conflicting updates is that all update actions you specify as part of a request should be able to be executed in any order with the same result. If that's not true, it's a conflicting update. There's various reasons for this, the easiest of which is that XQuery is a functional language and this is an aspect of that.
It means you can't, for example, add a node and then give it a child node. Because that's order dependent. Nor can you delete a node and then delete its parent. Again, order dependent.
You very much can, however, update the same document multiple times in the same transaction, so long as you're dealing with different parts of the document so that execution order of updates isn't important.
Writing the same document multiple times in a transaction would be, as Ryan says, conflicting.
-jh-
On Oct 28, 2010, at 3:08 AM, semerau at hotmail.com<mailto:semerau at hotmail.com> wrote:
That error usually means that two updates are being attempted on a document in the same transaction. I looked at the code and I'm not seeing two updates so I'm wondering if maybe two docs are being written with the same URI in the set of documents you are loading?
________________________________
From: Pragya_Kapoor at infosys.com<mailto:Pragya_Kapoor at infosys.com>
To: general at developer.marklogic.com<mailto:general at developer.marklogic.com>
Date: Thu, 28 Oct 2010 12:11:45 +0530
Subject: [MarkLogic Dev General] (no subject)
Hi,
I am using the attached files to manipulate the xml data and then insert in ML DB using record loader.
I am getting the following error:
XDMP:OCNFLICTINGUPDATE
Please let me know what I am doing wrong
Thnaks,
Pragya
**************** CAUTION - Disclaimer *****************
This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended solely
for the use of the addressee(s). If you are not the intended recipient, please
notify the sender by e-mail and delete the original message. Further, you are not
to copy, disclose, or distribute this e-mail or its contents to any other person and
any such actions are unlawful. This e-mail may contain viruses. Infosys has taken
every reasonable precaution to minimize this risk, but is not liable for any damage
you may sustain as a result of any virus in this e-mail. You should carry out your
own virus checks before opening the e-mail or attachment. Infosys reserves the
right to monitor and review the content of all messages sent to or from this e-mail
address. Messages sent to or from this e-mail address may be stored on the
Infosys e-mail system.
***INFOSYS******** End of Disclaimer ********INFOSYS***
_______________________________________________ General mailing list General at developer.marklogic.com<mailto:General at developer.marklogic.com> http://developer.marklogic.com/mailman/listinfo/general_______________________________________________
General mailing list
General at developer.marklogic.com<mailto:General at developer.marklogic.com>
http://developer.marklogic.com/mailman/listinfo/general
_______________________________________________ General mailing list General at developer.marklogic.com http://developer.marklogic.com/mailman/listinfo/general
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://developer.marklogic.com/pipermail/general/attachments/20101028/5e9aa386/attachment-0001.html
More information about the General
mailing list