Skip to main content

"createTransactionSavePoint"

JSON DB "createTransactionSavePoint" action creates a transaction savepoint and returns a unique identifier for the savepoint in the transactionSavepointId property

The "createTransactionSavePoint" action creates a transaction savepoint and returns a unique identifier for the savepoint in the "transactionSavepointId" property. A savepoint bookmarks the current point in the transaction process. You can create multiple savepoints and use "revertTransactionToSavepoint" to undo changes back to any savepoint.

  • A transaction savepoint represents the current point in the transaction process specified by the "transactionId" property.

  • A client can roll back a transaction to any savepoint by calling the "revertTransactionToSavepoint" 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. This action is equivalent to and more efficient than running the "revertTransactionToSavepoint" action followed by "commitTransaction".

Request examples

Request examples

Minimal request

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

Successful response

{
  "authToken": "authToken",
  "result": {
    "transactionSavepointId": 1
  },
  "errorCode": 0,
  "errorMessage": ""
}

Use the createTransactionSavePoint JSON API action to create a transaction savepoint and return a unique identifier for the savepoint

API actionsJSON DB APIjsonActiontransaction actionscreate transaction save pointcreateTransactionSavePoint

The "params" property is an object that contains an action's parameters. Each action defines its own required and optional properties.

Properties summary

Table 1. "params" properties summary

Property

Description

Default

Type

Limits (inclusive)

transactionId

specifies a server-generated ID that represents a transaction

""

string

0 to 255 bytes



Properties summary

Table 2. "result" properties summary

Property

Description

Type

Limits (inclusive)

transactionSavePointId

specifies a server-generated ID that represents a savepoint

string

0 to 255 bytes



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.