"rollbackTransaction"
JSON DB "rollbackTransaction"
action rolls back a transaction and, when successful, ensures all actions attached to the transaction are completely undone
The "rollbackTransaction"
action closes a transaction created by "createTransaction"
and discards all changes made by actions attached to the transaction.
When the rollback completes, it closes the transaction.
When a transaction is closed, the associated
"transactionId"
becomes invalid and can no longer be used.
Request examples
Minimal request
{ "api": "db", "action": "rollbackTransaction", "params": { "transactionId": "replaceWithTransactionIdFromCreateTransaction" }, "authToken": "replaceWithAuthtokenFromCreateSession" }
{ "api": "db", "action": "rollbackTransaction", "params": { "transactionId": "replaceWithTransactionIdFromCreateTransaction" }, "responseOptions": {}, "authToken": "replaceWithAuthtokenFromCreateSession", "apiVersion": "1.0", "requestId": "2", "debug": "max" }
{ "authToken": "authtoken", "errorCode": 0, "errorMessage": "" }
Use the rollbackTransaction JSON API action to roll back a transaction and ensure all actions attached to the transaction are completely undone
The "params"
property is an object that contains an action's parameters. Each action defines its own required and optional properties.
Properties summary
"params"
properties summaryProperty | Description | Default | Type | Limits (inclusive) |
---|---|---|---|---|
specifies a server-generated ID that represents a transaction |
| string | 0 to 255 bytes | |
specifies a server-generated ID that represents a savepoint |
| string | 0 to 255 bytes |
The "transactionId"
is an option string that the server generates in order to return during a "createTransaction"
action. The generated ID represents a transaction. It defaults to an empty string.
When a client wants an action to be under control of a transaction, it must include the
"transactionId"
in the action.A
"transactionId"
is valid and can be applied to many actions until it is either committed using"commitTransaction"
or rolled back using the"rollbackTransaction"
.A zero-length string mean the
"transactionId"
is invalid.Do not assume that
"transactionId"
is a number embedded in a string.
The "transactionSavepointId"
is an optional string that the server generates in order to return during a "createTransactionSavepoint"
action. The generated ID represents a savepoint. It defaults to an empty string.
A transaction savepoint represents the current point in the transaction process.
A client can roll back a transaction to any savepoint by calling the
"rollbackTransaction"
action with the desired"transactionSavepointId"
property.A client can commit a transaction to any savepoint by calling the
"commitTransaction"
action with the desired"transactionSavepointId"
property.A zero-length string means the
"transactionSavepointId"
is invalid.Do not assume that the
"transactionSavepointId"
is a number embedded in a string.