Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>With MarkLogic an entire XQuery update normally acts like a single transaction. When <code>mut:release</code> adds an update to the transaction's stack, the rest of the query will not see that update until after it commits. From the point of view of the query, this normally happens <em>after</em> the entire query finishes, and is not visible to the query.</p> <p>The docs have something useful to add about what <a href="http://docs.marklogic.com/xdmp:rollback" rel="nofollow">http://docs.marklogic.com/xdmp:rollback</a> does:</p> <blockquote> <p>When a transaction is rolled back, the current statement immediately terminates, updates made by any statement in the transaction are discarded, and the transaction terminates.</p> </blockquote> <p>So it isn't that the variables are demolished: it's that your program is over.</p> <p>I think <a href="http://docs.marklogic.com/guide/app-dev/transactions#id_15746" rel="nofollow">http://docs.marklogic.com/guide/app-dev/transactions#id_15746</a> has an example that is fairly close to your use-case: "Example: Multi-statement Transactions and Same-statement Isolation". It demonstrates how to <code>xdmp:eval</code> or <code>xdmp:invoke</code> to update a document and see the results within the same query.</p> <p>Test it to see that it works, then replace the <code>xdmp:commit</code> with an <code>xdmp:rollback</code>. For me the example still works. Start replacing the rest of the logic with your unit test logic, and you should be on your way.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload