Hour 6, "Managing Database Transactions"

Quiz Answers

1: True or false: If you have committed several transactions, have several more transactions that have not been committed, and issue a ROLLBACK command, all your transactions for the same session are undone.
A1: False. When a transaction is committed, the transaction cannot be rolled back.
2: True or false: A SAVEPOINT actually saves transactions after a specified amount of transactions have executed.
A2: False. A SAVEPOINT is only used as a point for a rollback to return to.
3: Briefly describe the purpose of each one of the following commands: COMMIT, ROLLBACK, and SAVEPOINT.
A3: The COMMIT saves changes made by a transaction. The ROLLBACK undoes changes made by a transaction. The SAVEPOINT creates logical points in a transaction in which to roll back.

Exercise Answers

1: Take the following transactions and create SAVEPOINTs after every three transactions. Then, COMMIT the transactions.
transaction1;
transaction2;
transaction3;
transaction4;
transaction5;
transaction6;
transaction7;
transaction8;
transaction9;
transaction10;
transaction11;
transaction12;

A1:
SAVEPOINT SAVEPOINT1
TRANSACTION1;
TRANSACTION2;
TRANSACTION3;
SAVEPOINT SAVEPOINT2
TRANSACTION4;
TRANSACTION5;
TRANSACTION6;
SAVEPOINT SAVEPOINT3
TRANSACTION7;
TRANSACTION8;
TRANSACTION9;
SAVEPOINT SAVEPOINT4
TRANSACTION10;
TRANSACTION11;
TRANSACTION12;
COMMIT;
									

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset