Details
-
Bug
-
Resolution: User Error
-
Critical
-
None
-
None
-
None
-
1
Description
I made a transaction with 3 separate queries in and then threw an error at the end. The Insert and the Update have rolled back correctly and have not made changes, however the Delete still deletes the document and it cannot be found in a get or the UI after the successful rollback of the others.
Code Used:
await clusterConnection.transactions().run(async (attempt) => {
|
await attempt.query("INSERT INTO `airline` VALUES ($1, $2)", { scope: inventory, parameters: ['airline_' + doc1.id, doc1] }) |
await attempt.query("UPDATE airline SET iata = $1 WHERE id = $2", { scope: inventory, parameters: ['SCE', doc2.id] }) |
await attempt.query("DELETE FROM `airline` WHERE id = $1", { scope: inventory, parameters: [8745] }) |
throw 'Rollback'; |
})
|