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.