The docs http://docs.marklogic.com/guide/xcc/concepts#id_23310 and http://docs.marklogic.com/guide/xcc/concepts#id_57048 describe ways to do something like that - but from Java. I don't think all the necessary functionality is exposed in pure XQuery. You can examine currently-active transactions, but I don't see a way to join an active transaction.
You might look at how Info Studio does this sort of thing: http://docs.marklogic.com/infodev and http://docs.marklogic.com/guide/infostudio -- Mike On 13 Aug 2013, at 07:17 , "Christensen, David (RBI)" <[email protected]> wrote: > I was wondering if there was a way that I could span a transaction across > multiple requests to individual xqy modules, and commit/rollback at any > point. According to the documentation of using transactions within xquery > modules, it seems like transactions only last for the lifetime of the request > to the module. Functions like xdmp:set-transaction-mode() only seem to modify > the transaction that is implicitly created by calling an xquery module, and > even if you are in ‘update’ mode, the transaction doesn’t persist beyond the > lifetime of the request. > > Here’s an example of what I would like to do: > > POST http://server/v1/manage/transactions (create transaction and obtain txid > 1234) > POST http://server/doThisXQuery.xqy?txid=1234 (post a document and associate > it with txid 1234) > POST http://server/nowDoThisXQuery.xqy?txid=1234 (post another document and > associate it with txid 1234) > GET http://server/finishTransaction?txid=1234 (validate document integrity > and either commit/rollback txid 1234) > > Thank you, > Dave Christensen > > > _______________________________________________ > General mailing list > [email protected] > http://developer.marklogic.com/mailman/listinfo/general _______________________________________________ General mailing list [email protected] http://developer.marklogic.com/mailman/listinfo/general
