Questions: Savepoints: Partial Rollback Within Transactions

5 questions to test your understanding

Score: 0 / 5
Question 1 Multiple Choice

A transaction executes 10 INSERT statements, then sets a savepoint, then attempts an 11th INSERT that violates a constraint. The application issues ROLLBACK TO SAVEPOINT. What is the state of the database after this command?

AThe first 10 inserts are committed and the 11th is discarded
BAll 11 inserts are rolled back, returning to the state before the transaction began
CThe first 10 inserts are preserved within the transaction (still uncommitted), the 11th is undone
DThe 11th insert is retried automatically with the constraint relaxed
Question 2 Multiple Choice

A batch import transaction sets a savepoint before each of 100 record inserts. Records 1–50 succeed; record 51 fails a constraint, so the application rolls back to that record's savepoint and logs the error; records 52–100 succeed. The transaction then issues COMMIT. What happens?

AOnly records 52–100 are committed, because rolling back to a savepoint discards all prior work
BRecords 1–50 and 52–100 are committed; record 51's failed insert is not
CNothing is committed — the ROLLBACK TO SAVEPOINT invalidated the entire transaction
DAll 100 records are committed because savepoints do not affect COMMIT behavior
Question 3 True / False

Rolling back to a savepoint commits most changes made before that savepoint, making them permanent in the database.

TTrue
FFalse
Question 4 True / False

After rolling back to a savepoint, the application can re-execute the failed operation with corrected values and continue the transaction normally.

TTrue
FFalse
Question 5 Short Answer

What is the fundamental difference between a savepoint and a COMMIT, and why does this distinction matter when designing bulk-processing transactions?

Think about your answer, then reveal below.