For more details, the Understanding Transactions 
chapter<http://docs.marklogic.com/guide/app-dev/transactions#chapter> of the 
Application Developer's Guide is a good resource. What you'll probably need to 
do is have saveFunction run in an eval statement as a separate transaction.

David Cassel
Vanguard Technical Manager
MarkLogic<http://www.marklogic.com>


From: David Lee <[email protected]<mailto:[email protected]>>
Reply-To: MarkLogic Developer Discussion 
<[email protected]<mailto:[email protected]>>
Date: Tuesday, April 16, 2013 3:03 PM
To: MarkLogic Developer Discussion 
<[email protected]<mailto:[email protected]>>
Subject: Re: [MarkLogic Dev General] Document insert

saveFunction and anotherFunction are run in the same transaction so 
anotherFunction will not "see" the new document until you commit the 
transaction.


-----------------------------------------------------------------------------
David Lee
Lead Engineer
MarkLogic Corporation
[email protected]<mailto:[email protected]>
Phone: +1 812-482-5224
Cell:  +1 812-630-7622
www.marklogic.com<http://www.marklogic.com/>


From: 
[email protected]<mailto:[email protected]>
 [mailto:[email protected]] On Behalf Of Chad Bishop
Sent: Tuesday, April 16, 2013 2:57 PM
To: [email protected]<mailto:[email protected]>
Subject: [MarkLogic Dev General] Document insert

Greetings,

I have the following situation:

let $var …
for …
where …
return
                let $a …
                let $b …
                let $save := saveFunction($param)
                return ($a, anotherFunction($b)…)

That saveFunction is inserting a document…or supposed to.

What I’ve found is it doesn’t actually insert the document unless I:

return $save

Why is that?  It matters in this situation because anotherFunction() depends on 
the document existing.

Thank you for any help,

-Chad
_______________________________________________
General mailing list
[email protected]
http://developer.marklogic.com/mailman/listinfo/general

Reply via email to