This action undoes all transaction changes made after the savepoint and keeps the transaction open to allow more actions to run inside the transaction.
Important JSON DB API does not support "revertTransactionToSavepoint" when the transaction contains a call to "getRecordsUsingSQL" or "runSqlStatements"; instead, the JSON DB API returns an error.
The JSON DB API does support "rollbackTransaction" and "commitTransaction" when the transaction contains "getRecordsUsingSQL" or "runSqlStatements".
- All transactions after the savepoint are permanently discarded, and changes up to the savepoint still need to be committed. This can undo changes to records, tables, indexes, etc.
- This action cannot be undone.
- This action does not close a transaction.
- Additional commands can continue to be executed under transaction control.
- To commit all changes up to the savepoint, call the "commitTransaction" command.
- A transaction can only be closed by "commitTransaction" or "rollbackTransaction".
Request examples
Minimal
{
"action": "revertToTransactionSavepoint",
"params": {
"transactionId": "replaceWithTransactionIdFromCreateTransaction",
"transactionSavepointId": 1
},
"authToken": "replaceWithAuthTokenFromCreateSession"
}Maximal
{
"api": "db",
"action": "revertToTransactionSavepoint",
"params": {
"transactionId": "replaceWithTransactionIdFromCreateTransaction",
"transactionSavepointId": 1
},
"responseOptions": {},
"apiVersion": "1.0",
"requestId": "2",
"debug": "max",
"authToken": "replaceWithAuthTokenFromCreateSession"
}
Response examples
Success
{
"errorCode": 0,
"errorMessage": "",
"authToken": "replaceWithAuthTokenFromCreateSession"
}Maximal
{
"authToken": "replaceWithAuthTokenFromCreateSession",
"requestId": "00000002",
"debugInfo": {
"request": {
"authToken": "replaceWithAuthTokenFromCreateSession",
"api": "db",
"action": "revertToTransactionSavepoint",
"params": {
"transactionId": "replacedWithValidTransactionId",
"transactionSavepointId": 1
},
"requestId": "00000002",
"debug": "max"
}
},
"errorCode": 0,
"errorMessage": ""
}
Request properties ("params")
| Property | Description | Default | Type | Limits (inclusive) |
|---|---|---|---|---|
transactionId |
The "transactionId" property identifies a transaction in which the specified action will be included. |
Optional with default of ""
|
string | 0 to 255 bytes |
transactionSavepointId |
The
|
Optional with default of |
string | 0 to 255 bytes |