Hi David and Florent,
Thanks for your reply. I tried below transaction settings, but throwing
error

declareUpdate({explicitCommit: true}),

xdmp.setTransactionMode("update-auto-commit"),

xdmp.documentInsert(newuri,odiObj,[xdmp.permission("rest-reader",
"read"),xdmp.permission("rest-writer", "update")] ,materializedView,100),

 xdmp.commit();


My scenario:

=> While in the INITIAL state of a record, it looks in collection-1, if
found, over-write the details else it creates a new document in another
format in that collection-1. This continues in a loop of 5 records. For
this I am using Content Processing Framework pipelines and triggers. Please
advise.




On Mon, Oct 17, 2016 at 3:00 PM, <general-requ...@developer.marklogic.com>
wrote:

> Send General mailing list submissions to
>         general@developer.marklogic.com
>
> To subscribe or unsubscribe via the World Wide Web, visit
>         http://developer.marklogic.com/mailman/listinfo/general
> or, via email, send a message with subject or body 'help' to
>         general-requ...@developer.marklogic.com
>
> You can reach the person managing the list at
>         general-ow...@developer.marklogic.com
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of General digest..."
>
>
> Today's Topics:
>
>    1. Re: search after xdmp.documentInsert() getting 0 results
>       (David Gorbet)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Mon, 17 Oct 2016 17:44:15 +0000
> From: David Gorbet <david.gor...@marklogic.com>
> Subject: Re: [MarkLogic Dev General] search after
>         xdmp.documentInsert() getting 0 results
> To: MarkLogic Developer Discussion <general@developer.marklogic.com>
> Message-ID:
>         <90D984E0D0F0624B80CC39BFFAA529B20CC901F5@EXCHG10-BE01.
> marklogic.com>
> Content-Type: text/plain; charset="utf-8"
>
> Note that this is not quite true. Changes to documents are not visible to
> other code in the same statement, but when executing a multi-statement
> transaction, changes made in one statement are visible to subsequent
> statements within the same transaction.
>
> So a transaction can read a modification it has done itself, but only if
> it is a multi-statement transaction.
>
> From: general-boun...@developer.marklogic.com [mailto:general-bounces@
> developer.marklogic.com] On Behalf Of Florent Georges
> Sent: Sunday, October 16, 2016 5:03 AM
> To: MarkLogic Developer Discussion <general@developer.marklogic.com>
> Subject: Re: [MarkLogic Dev General] search after xdmp.documentInsert()
> getting 0 results
>
>
> It looks like you try to read a document you inserted in the same
> transaction. Which is in contradiction with how transactions work on
> MarkLogic.
>
> You can think of it as the following simplification: all changes to
> documents (including inserting new ones) are accumulated whilst your code
> is executing, then actually written to the database when the transaction
> automatically commits, after the code has completed.
>
> The same query therefore cannot read a modification it has done itself.
>
> Regards,
>
> On 16 Oct 2016 05:45, "Shiv Shankar" <shiv.shivshan...@gmail.com<mailto:
> shiv.shivshan...@gmail.com>> wrote:
> Hi,
> I tried all the possibilities in fetching the results using jsearch.search
> after using xdmp.documentInsert() ( I used declareUpdate() on top) in CPF
> process, but resulting no documents in the collection.  After this process,
> when I do same search , I get the results.
> I used xdmp.commit() exclusively but in vein.
> Why it s taking time to persists the documents in to the database when I
> do with JavaScript?  Any thoughts.
>
> Reegards
> Shiv.
>
>
>
>
>
> _______________________________________________
> General mailing list
> General@developer.marklogic.com<mailto:General@developer.marklogic.com>
> Manage your subscription at:
> http://developer.marklogic.com/mailman/listinfo/general
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: http://developer.marklogic.com/pipermail/general/
> attachments/20161017/3b3fc640/attachment-0001.html
>
> ------------------------------
>
> _______________________________________________
> General mailing list
> General@developer.marklogic.com
> Manage your subscription at:
> http://developer.marklogic.com/mailman/listinfo/general
>
>
> End of General Digest, Vol 148, Issue 26
> ****************************************
>
_______________________________________________
General mailing list
General@developer.marklogic.com
Manage your subscription at: 
http://developer.marklogic.com/mailman/listinfo/general

Reply via email to