This topic lists the operations available in the Transaction Web Service.
A request to the Transaction Web Service consists of a Request element.
| Operation | Description |
|---|---|
| startOuterTransaction | An operation to begin an outer transaction.
You can optionally provide a transaction ID in the
OuterTransactionId element.
If this operation succeeds, it starts the outer transaction and returns a transaction ID, and the Dgraph enters transaction mode. If this operation does not succeed, the Dgraph does not start an outer transaction, and does not return a transaction ID. While an outer transaction is in progress, the following
actions take place:
Updates applied within the outer transaction do not become a published version of the index until another operation, commitOuterTransaction, returns successfully. |
| listOuterTransaction | An operation to request an ID of a running outer transaction. If an outer transaction is in progress, this operation returns its ID. |
| rollBackOuterTransaction | An operation to roll back an outer transaction with the ID specified in the OuterTransactionIdToRollBack element. |
| commitOuterTransaction | An operation to end an outer transaction.
If an outer transaction with the specified ID is in progress, then if the operation succeeds, the Dgraph commits the transaction and exits transaction mode. The Dgraph resumes accepting unqualified queries. The version of the index that is propagated to all nodes becomes the last published version. If the operation does not succeed, the outer transaction is not committed. The Dgraph does not apply any updates that referenced the transaction ID. All queries continue to use the pre-transaction version of the index. Note: If the outer transaction fails to commit, it remains
open, and you cannot start another outer transaction before committing or
rolling back the one that failed. Without stopping the Dgraph, you can manually
commit the transaction and roll back any changes using the
rollBackOuterTransaction operation,
specifying the ID of the transaction. If, in another possible scenario, the
outer transaction fails to commit because the Dgraph fails, the transaction is
not applied and does not need to be rolled back manually.
|