0

Is there a way in server side javascript in marklogic where I can prove that the statements within a single transaction can view the updates of each other. And when the transaction gets rolled back, the updates are not visible outside. Basically I wanted to prove that we can write multiple statements within a single transaction, that can see the updates of each other just like how it works in case of Xquery(statements separated by ";")

I tried xdmp.eval, but that doesnt work. Because we have an option isolation which can take one of 2 values - either same-statement or different-transaction. When I give same-statement, another statements in the transaction are not able to view the update made through same-statement. When I use different-transaction, the whole logic wont work.Because then the statement itself becomes a different transaction.

What I wanted is a single transaction with multiple lines of statements, with each line able to view the updates of other lines/statements.

sharu
  • 71
  • 5
  • Possible duplicate of [JavaScript Multi-statement Transaction in Marklogic](https://stackoverflow.com/questions/53282962/javascript-multi-statement-transaction-in-marklogic) – Mads Hansen Nov 21 '18 at 04:39
  • The solution to the question in the post doesn't work – sharu Nov 27 '18 at 10:11
  • @sharu I have a hunch about the problem you ran into with your xdmp.eval code using `different-transaction`. Can you post the code you tried? – Dave Cassel Dec 06 '18 at 01:31

0 Answers0