Uploaded image for project: 'Couchbase node.js Client Library'
  1. Couchbase node.js Client Library
  2. JSCBC-983

Query Remove in Transaction doesn't rollback

    XMLWordPrintable

Details

    • Bug
    • Resolution: User Error
    • Critical
    • 4.0.0
    • 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';
                })

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            brett19 Brett Lawson
            matthew.bray Matthew Bray
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes

                PagerDuty