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

For a list and detailed description of the common properties in an action request message, see JSON Action request.

 

Minimal

{
  "api": "db",
  "action": "rollbackTransaction",
  "params": {
    "transactionId": "replaceWithTransactionIdFromCreateTransaction"
  },
  "authToken": "replaceWithAuthTokenFromCreateSession"
}

 

Maximal

{
  "api": "db",
  "action": "rollbackTransaction",
  "params": {
    "transactionId": "replaceWithTransactionIdFromCreateTransaction"
  },
  "responseOptions": {},
  "apiVersion": "1.0",
  "requestId": "2",
  "debug": "max",
  "authToken": "replaceWithAuthTokenFromCreateSession"
}

 

Response examples

For a list and detailed description of the common properties in an action response message, see JSON Action response.

 

Minimal

{
  "errorCode": 0,
  "errorMessage": "",
  "authToken": "replaceWithAuthTokenFromCreateSession"
}

 

"params"

The "params" property is an object that contains an action's request parameters as defined by a set of properties. Each action defines its own required and optional properties. See System specifications for a comprehensive overview of property requirements and limitations.

rollbackTransaction "params" properties summary
Property Description Default Type Limits (inclusive)

transactionId

(optional) identifies a server-generated ID that represents a point in the progress of a transaction.

""

string 0 to 255 bytes
transactionSavepointId (optional) identifies a server-generated ID that represents a point in the progress of a transaction. "" string 0 to 255 bytes

 

"transactionId"

The "transactionId" is an optional string that the server generates and returns during a "createTransaction" action. The generated ID represents a transaction. In requests, it defaults to an empty string.

  • When a client wants an action to be controlled by a transaction, the "transactionId" must be included in the action request.
  • A "transactionId" is valid and can be applied to multiple actions until it is either committed using "commitTransaction" or rolled back using "rollbackTransaction".
  • A zero-length string means the "transactionId" is invalid.
  • Do not assume that "transactionId" is a number embedded in a string.

 

"transactionSavepointId"

The "transactionSavepointId" is a string that the server generates and returns in a "createTransactionSavepoint" action. The generated ID represents a point in a transaction's progress. In requests, 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 returned in a response means the "transactionSavepointId" provided in the request is invalid.
  • Do not assume that the "transactionSavepointId" is a number in a string.