elise-ng / COMP4111_Project

0 stars 0 forks source link

[Specification] Transaction rollback behavior #13

Closed oscarngncc closed 4 years ago

oscarngncc commented 4 years ago

When multiple statement is passed to the transaction and committed, it shall rollback/not make any change if one of the statements causes error.

However, based on the testing, I have chained two statements ( first one being right and last being wrong). Committing results in 200 SC_OK and the first SQL statement is executed.

{ "Transaction": {{transaction1}}, "Book": 50, "Action": "loan" } { "Transaction": {{transaction1}}, "Book": 999999, "Action": "return" }

Transaction in the db: (Obviously one with id=999999 is wrong) image

Commit success (somehow) image

Database does make valid book (id=50) being loaned image

Collection Link: https://www.getpostman.com/collections/60fd4e59edd2e444ed04

Camerash commented 4 years ago

Specification found and bug confirmed.

comp4111ta commented 4 years ago

TA Verified: Exceptions found by manual code review (1pt)