Committing the transaction
GQL provides a COMMIT statement to finalize and submit all modifications made within a transaction.
To commit a transaction and apply all changes, use the following:
GQL:
COMMIT
The COMMIT command finalizes a transaction by applying all changes made to the graph database.
If an error occurs during the commit process, the operation fails, and all changes to the graph data and catalog are discarded. Otherwise, the commit is successful, and the transaction is concluded.
Here is a complete example of committing a transaction:
- Start a transaction:
GQL: START TRANSACTION
This query initiates a transaction.
- Modify the data:
GQL: MATCH (n) FILTER n.name = "GQL" SET n.name = "gql"
This query finds nodes named GQL and changes the name to lowercase, gql.
- Commit the transaction:
GQL3: COMMIT
This query commits the transaction...