Thanks John
I'm using xdmp:transaction-create() with the update mode option.
xdmp:transaction-create(
<options xmlns="xdmp:eval">
<transaction-mode>update</transaction-mode>
</options>
I'm using this xdmp:eval() with the transaction-id option.
xdmp:eval(
$evalCmd,
(xs:QName("uri"), $uri),
<options xmlns="xdmp:eval">
<transaction-id>{$longTxId}</transaction-id>
</options>
I posted the REST Extension Code here. =>
https://github.com/garyrusso/GLM-Search
I also posted a C# tool that I use to call the REST Extension APIs to test
the ACID rollbacks. => https://github.com/garyrusso/ACIDTester
-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of John Snelson
Sent: Tuesday, October 07, 2014 5:29 AM
To: [email protected]
Subject: Re: [MarkLogic Dev General] How to call xdmp:eval() with
transaction-id option?
Grep the server Modules and Apps directory to find uses of it. You probably
also want to find out about xdmp:transaction-create() as well.
Maybe it's time we documented this functionality - I've seen lots of people
wanting to use it recently.
John
On 06/10/14 23:55, Gary Russo wrote:
> I'm creating a set of REST extensions that will be used in
> Mulit-Statement ACID Transactions.
>
> The underlying code will use xdmp:eval() with the transaction-id option.
>
> Unfortunately, the transaction-id option is undocumented.
>
> Can someone please provide an example of using xdmp:eval() with a
> transaction-id option?
>
>
> Here's the RESTful APIs that are being created.
>
> 1. POST /transaction (:
> Returns a transaction-id. e.g., 11111111 :) 2. GET
> /inventory?rs:type=artichoke&rs:transId=11111111
> 3. GET /inventory?rs:type=bongo&rs:transId=11111111
> 4. PUT
> /inventory?rs:type=artichoke&rs:transId=11111111&rs:action=decr&rs:qua
> ntity=
> 3
> 5. PUT
> /inventory?rs:type=bongo&rs:transId=11111111&rs:action=decr&rs:quantity=1
> 6. POST /order?rs:transId=11111111 (: Prepares Document
> Insert :)
> 7. PUT /transaction?rs:transId=11111111 (: commits transaction
:)
> 8. DELETE /transaction?rs:transId=11111111 (: rolls back transaction
:)
>
>
> Thanks in advance.
>
> - GR
>
>
> Gary Russo
> Enterprise NoSQL Developer
> <http://garyrusso.wordpress.com> http://garyrusso.wordpress.com
>
>
>
> _______________________________________________
> General mailing list
> <mailto:[email protected]> [email protected]
> <http://developer.marklogic.com/mailman/listinfo/general>
http://developer.marklogic.com/mailman/listinfo/general
>
--
John Snelson, Lead Engineer <http://twitter.com/jpcs>
http://twitter.com/jpcs
MarkLogic Corporation <http://www.marklogic.com>
http://www.marklogic.com
_______________________________________________
General mailing list
<mailto:[email protected]> [email protected]
<http://developer.marklogic.com/mailman/listinfo/general>
http://developer.marklogic.com/mailman/listinfo/general
_______________________________________________
General mailing list
[email protected]
http://developer.marklogic.com/mailman/listinfo/general