CS 4337 - Exam 2 - Chapter 20

¡Supera tus tareas y exámenes ahora con Quizwiz!

______ and _____ specify transaction boundaries. A. START, COMMIT B. START, STOP C. BEGIN, END D. BEGIN, COMMIT

C. BEGIN, END

A ________ avoids cascading rollbacks if every transaction in the schedule reads only items that were written by committed transactions. A. Strict schedule B. Committed Schedule C. Cascadeless Schedule

C. Cascadeless Schedule

_________ occur sometimes in recoverable schedules when uncommitted transactions need to be reconsidered because an item was read from a transaction that failed. A. Temporary Rollback B. Re-Read C. Cascading Rollback D. Strict Rollback

C. Cascading Rollback

The size of a data item is called its __________. A. Item Size B. Size C. Granularity D. Record Size

C. Granularity

What is view equivalence? A. In serial schedules, if two schedules are conflict serializable and their serializable schedule equivalents are the inverse of each other, it is said to be view equivalent. B. In scheduling, if two schedule look the same, they are view equivalent. C. In scheduling, if each read operation of a transaction reads the result of the same write operation in both schedules, the write operation of each transaction must produce the same results D. A & C, but not B

C. In scheduling, if each read operation of a transaction reads the result of the same write operation in both schedules, the write operation of each transaction must produce the same results

The _________ of operations states that for any two operations in the schedule, one must occur before the other. A. BCNF Ordering B. FCFS Ordering C. Total Ordering D. Sequential Ordering

C. Total Ordering

A ______ occurs when data is read in twice inside the same transaction but cannot guarantee the value has been unchanged. A. Phantom Read B. Repeatable Read C. Unrepeatable Read D. Dirty Read

C. Unrepeatable Read

What are the constraints for two conflicting operations to occur?

1. Operations belong to different transactions 2. Operations access the same item 3. At least one of the operations is a write_item

The _________ is the order of execution of operations from all transactions. A. Query Plan B. Operational Order C. Schedule D. Total Ordering

C. Schedule

Mix & Match A. The Lost Update Problem B. The Temporary Update (Dirty Read) Problem C. The Incorrect Summary Problem D. The Unrepeatable Read Problem 1. One transaction is calculating an aggregate summary on a number of records while other transactions are updating some of these records, the aggregate function calculates values before they're updated. 2. Two transactions accessing the same database with operations that interleaved, resulting in incorrect value of some database items. 3. One transaction updates a database item and then the transaction fails; but the updated item is accessed by another transaction before it is reverted to its original value. 4. One transaction reads the same item twice and the item is changed by another transaction between the two reads.

(A,2),(B,3),(C,1),(D,4) The Lost Update Problem Two transactions accessing the same database with operations that interleaved, resulting in incorrect value of some database items. The Temporary Update (Dirty Read) Problem One transaction updates a database item and then the transaction fails; but the updated item is accessed by another transaction before it is reverted to its original value. The Incorrect Summary Problem One transaction is calculating an aggregate summary on a number of records while other transactions are updating some of these records, the aggregate function calculates values before they're updated. The Unrepeatable Read Problem One transaction reads the same item twice and the item is changed by another transaction between the two reads.

Mix & Match. A. Atomicity B. Consistency Preservation C. Isolation D. Durability 1. Not interfered with by other transactions executing concurrently 2. Changes must persist in the database and must not be lost due to any failure 3. Takes database from one state to another 4. Transactions are performed in all or nothing style

(A,4),(B,3),(C,1),(D,2) Atomicity Transaction performed in its entirety or not at all Consistency Preservation Takes database from one consistent state to another Isolation Not interfered with by other transactions executing concurrently Durability Changes must persist in the database, changes must not be lost because of any failure together these form the ACID properties

What is the algorithm for testing serializability of a schedule?

1. For each transaction in a schedule, create a node labeled for that transaction in a precedence graph 2. For each case in S where Tz executes a read after Ty does a write, create directed edge (Ty, Tz) 3. For each case in S where Tz executes a write after Ty does a read, create directed edge (Ty, Tz) 4. For each case in S where Tz executes a write after Ty does a write, create directed edge (Ty, Tz) GRAPH HAS CYCLES --> S IS NOT SERIALIZABLE GRAPH HAS NO CYCLES -> S IS SERIALIZABLE

A _______ read occurs when one user is repeating a read operation on the same records, but has new records in the results set. A. Phantom Read B. Donkey Read C. Unrepeatable Read D. Dirty Read

A. Phantom Read

Transactions in a __________ can neither read nor write an item until the last transaction that wrote to that item has committed or aborted. A. Strict schedule B. Committed Schedule C. Cascadeless Schedule

A. Strict schedule

__________ finds the address of a disk block and copies X to and from a memory buffer. A. read_item(X) B. write_item(X) C. find_item(X)

A. read_item(X)

A _____________'s effects permanently are recorded in the database. Whereas __________ does not affect the database. A. Committed transaction, Reverted transaction B. Committed transaction, Aborted transaction C. Aborted transaction, Committed transaction D. Aborted transaction, Computer transaction

B. Committed transaction, Aborted transaction Committed = effects are recorded in db Aborted = does not affect db

In the Active State, managed by the DBMS, if a transaction is ended, the next state is _________. A. Abort B. Partially Committed C. Terminated D. Committed

B. Partially Committed

What is NOT a possible conflicting operations? A. Write-write B. Read-Read C. Write-read D. Read-Write

B. Read-Read At least one of the operations MUST BE a Write in order for a conflict to occur

________ is used to keep track of all transaction operations. A. Commit Log B. System Log C. DBMS D. Page Table

B. System Log

_________ is used to keep track of transaction commits. A. Commit Log B. System Log C. DBMS D. Page Table

B. System Log

What all does the system need to keep track of for recovery purposes? A. Primary Index, File Name, Transaction Start, Transaction Stop B. When the transaction will be resumed in the future if aborted C. When the transaction starts, terminates, commits or aborts D. A & B, but not C

C. When the transaction starts, terminates, commits or aborts

________ finds the address of the disk block, copying to and from a memory buffer, and storing the updated disk block back to disk. A. update_item(X) B. store_item(X) C. write_item(X)

C. write_item(X)

Suppose that a schedule S has the following read and write operations for three transactions. R3(Y); W1(Y); W3(Z); R2(Z); R1(X); W1(X); W2(X) Is the schedule conflict serializable? If so, what's the equivalent serial schedule?

Conflict Serializable T3 -> T1 -> T2 In order for S to be conflict serializable, it's precedence graph MUST NOT have cycles. There are three transactions. Each transaction is a node in the precedence graph. R3(Y); W1(Y) R3 conflicts with W1 [T3 -> T1] W3(Z); R2(Z) R2 conflicts with W3 [T3 -> T2] R1(X); W2(X) R1,W1 conflicts with W2 [T1 -> T2] See that T3 -> T1, T3 -> T2, T1 -> T2, but since there is no in-edges to T1 nor T3 there are NO CYCLES. So, it IS SERIALIZABLE. To find an equivalent serial schedule, we use topological sort in the precedence graph. Basic Idea: 1. Start at node 2. Move to next node, remove all incident edges 3. continue until all nodes are visited. Start at T3, go to T1. ((T3, T1) and (T3, T2) are removed). from T1, go to T2. ((T1, T2) is removed). All nodes are visited. Serializable schedule is T3 -> T1 -> T2.

A DBMS is responsible for all of the following when a transaction is submitted except? A. Making sure all operations are completed successfully B. Making sure all effects are operations are recorded permanently C. Making sure the transaction does not have any effect on the database or any other transactions. D. A & B, but not C

D. A & B, but not C This is incorrect. The DBMS is responsible for: 1. Making sure ALL operations in the transaction are completed successfully and their effect is recorded permanently. If this is the case, the transaction is committed. 2. Making sure the transaction does not have any effect on the database or any other transactions. If this is the case, the transaction is aborted. These are two reasons why RECOVERY IS NEEDED

A _______ occurs when one transaction is allowed to read data that is being modified by another transaction that is running concurrently and has not yet committed itself. A. Phantom Read B. Unrepeatable Read C. Unreadable Read D. Dirty Read

D. Dirty Read

In SQL, _______ and _______ are used to end transactions. A. END, COMMIT B. STOP, END C. ROLLBACK, END D. ROLLBACK, COMMIT

D. ROLLBACK, COMMIT

The Recovery Manager keeps track of all except? A. Read B. Write C. BEGIN_TRANSACTION D. TRY

D. TRY

After the Committed State, the next state is __________. A. Active B. Partially Committed C. Failed D. Terminated

D. Terminated

Suppose after a series of read and writes for a given transaction, the transaction ends. During the commit, something goes wrong and it aborts. What is the final state the state transition diagram will end up in? A. Abort B. Active C. Failed D. Terminated

D. Terminated To enter the active state, a transaction is begun. Within the active state is where the reading & writing occurs. When the transaction is ended it goes to the partially committed state. Where if successfully committed, it goes to the committed state. If not, it goes to the failed state. From both the committed and failed states, the next (final) state is the terminated state. So, this transaction went from Active ---> Partially Committed --> Failed --> Terminated

__________ is the logical unit of database processing which includes access operations such as read or write. A. Query B. Node C. Blob D. Transaction

D. Transaction

Which of the following problems are NOT due to lack of concurrency control? A. Two transactions accessing the same database with operations that are interleaved, resulting in incorrect value of some database items. B. One transaction updates a database item and then the transaction fails; but the updated item is accessed by another transaction before it is reverted to its original value. C. One transaction is calculating an aggregate summary on a number of records while other transactions are updating some of these records, the aggregate function calculates values before they're updated. D. One transaction reads the same item twice and the item is changed by another transaction between the two reads. E. One transaction takes a really long time to process because of multiple cross joins.

E. One transaction takes a really long time to process because of multiple cross joins. Concurrency ~ Multiple accesses at same time This option has nothing to do with that.

True or False? Being serializable is the same as being serial

False

True or False? The access modes, READ WRITE, READ ONLY, WRITE ONLY are all supported in SQL transaction processing.

False READ ONLY and READ WRITE

True or False? Recoverable schedules are always correct when concurrent transactions are executing.

False SERIAL SCHEDULES are.

True or False? Result equivalence schedules produce the same final state of the database between two schedules and can alone be used to determine if two schedules are equivalent.

False The first part is correct, but Result Equivalent schedules CANNOT be used alone to define equivalence of schedules.

True or False? Transaction processing concepts are dependent on the granularity of the data item.

False They are INDEPENDENT of item granularity

True or False? Some committed transactions need to be rolled back in recoverable schedules.

False NO committed transaction EVER needs to be rolled back in recoverable schedules.

Suppose that a schedule S has the following read and write operations for three transactions. R1(X); W2(X); R2(Y); W3(Y); R3(Z); W1(Z); Is the schedule conflict serializable?

Not conflict serializable In order for S to be conflict serializable, it's precedence graph MUST NOT have cycles. There are three transactions. Each transaction is a node in the precedence graph. R1(X); W2(X) R1 conflicts with W2 [T1 -> T2] R2(Y); W3(Y) R2 conflicts with W3 [T2 -> T3] R3(Z); W1(Z) R3 conflicts with W1 [T3 -> T1] See that T1 -> T2 -> T3 -> T1. Thus, there is a cycle. Therefore, this is NOT serializable

Suppose that a schedule S has the following read and write operations for two transactions. R1(X); R2(X); W1(X); R2(Y); W2(X); W2(Y) Is the schedule conflict serializable?

Not conflict serializable In order for S to be conflict serializable, it's precedence graph MUST NOT have cycles. There are two transactions. Each transaction is a node in the precedence graph. R1(X); W2(X) R1 conflicts with W2 [T1 -> T2] R2(X); W1(X) R2 conflicts with W3 [T2 -> T1] See that T1 -> T2 -> T1. There is a cycle. Therefore, NOT serializable

True or False? Transaction processing can be interleaved, whereby on processes can switch between partial execution of a transaction.

True

True or False? Transaction processing can be parallel, whereby multiple processes can be assigned a CPU to execute a transaction concurrently.

True

True or False? Two operations conflict if changing their order results in a different outcome.

True


Conjuntos de estudio relacionados

Comprehensive Review for the NCLEX-PN® Exam, 8e

View Set

2.5 Monetary Polices: Interest rates

View Set

Chapter 4: Stress Response Multiple choice

View Set

Microservices Interview Questions

View Set

CH.7 ENERGY BALANCE & WEIGHT CONTROL

View Set