Riap::Transaction - Transactions/undo/redo over Riap
version 1.1.18
1.1
This document specifies doing transactions/undo/redo over Riap.
This documentation specifies a set of Riap actions to do transaction/undo/redo over Riap. The actions basically correspond to TM's methods of the same/similar name, so please refer to Rinci::Transaction for more details on each action/method.
For these actions, Riap request key uri can be set to / as it is irrelevant.
uri
/
Additional Riap request keys: tx_id
tx_id
Some notes:
tx_id should ideally be hard to guess by other clients, for security.
tx_id should be passed as a Riap request key to every subsequent call request or any one of transaction-management actions described on this list, until the transaction is committed or rolled back.
call
Riap requests which does not incorporate tx_id key should not be affected by transaction management. But some servers, in order to maintain ACID property, can require that all subsequent call requests be inside some transaction. Call without transaction can be responded with 412 status in such case.
commit_tx
Additional required Riap request keys: tx_id.
Additional required Riap request keys: tx_id, tx_spid.
tx_spid
Additional required Riap request keys: tx_id
Optional Riap request keys: tx_spid
Rollback the transaction, or (if tx_spid is specified) rollback to a specific savepoint.
Additional required Riap request keys: tx_id, tx_spid
List client's transactions. Should return an array containing transaction ID's.
Optional request key: detail (bool, default false, is set to true will return an array of result records instead), tx_status (str, filter by transaction status).
detail
tx_status
Example:
# Riap request {"action":"list_txs", "uri":"/", "detail":1} # result [200, "OK", [ {"tx_id": "TX1", "tx_status":"C", "tx_start_time":1336043060, "tx_commit_time":1336043065, "tx_summary":"Some summary"}, {"tx_id": "TX2", "tx_status":"C", "tx_start_time":1336043070, "tx_commit_time":1336043071, "tx_summary":null}, {"tx_id": "TX3", "tx_status":"i", "tx_start_time":1336043090, "tx_commit_time":null, "tx_summary":"Some summary"}, ] ]
Optional Riap request keys: tx_id.
Undo a committed transaction (defaults to the newest committed transaction).
Redo a committed transaction (defaults to the newest undone committed transaction).
Additional required Riap request keys: none.
Discard all committed transactions for this client.
Riap
Rinci::Transaction
Steven Haryanto <stevenharyanto@gmail.com>
This software is copyright (c) 2012 by Steven Haryanto.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install Riap, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Riap
CPAN shell
perl -MCPAN -e shell install Riap
For more information on module installation, please visit the detailed CPAN module installation guide.