Recent Changes - Search:

Distributed Computing

This website demonstrates using wikis as teaching and learning tool.

The course instructor is also happy to share the teaching materials here with those who find it readable.

Transactions

Transactions Basics

  • What is an atomic transaction?
  • State the essential properties of a transaction.
  • What is the main difference between flat and nested transactions?
  • State three general reasons why a transaction may have to abort.

Concurrent Execution of Transactions

Consider the following three transactions. Suppose the initial balances of the three accounts A, B, and C are $400 each. Transaction T transfers $100 from Account A to Account B. Transaction U transfers $300 from Account C to Account B. Transaction V calculates the total amount of Accounts A, B, and C.

   Transaction T: 
     balanceT1 = READ(A);
     WRITE(A, balanceT1-100);
     balanceT2 = READ(B);
     WRITE(B, balanceT2+100);

   Transaction U:
     balanceU1 = READ(C);
     WRITE(C, balanceU1-300);
     balanceU2 = READ(B);
     WRITE(B, balanceU2+300);

   Transaction V:
     total = READ(A);
     total = total + READ(B);
     total = total + READ(C);
  • Consider the interleaving of Transactions T and U. Work out one interleaving schedule that has serial equivalence and another that will cause the lost updates problem.
  • Consider the interleaving of Transactions U and V. Work out one interleaving schedule that has serial equivalence and another that will cause the inconsistent retrievals problem.
  • Based on your observation while doing the above two tasks, can you think of some control rules to prevent the occurrence of lost updates and inconsistent retrievals problems?

Serially Equivalent and Order of conflicting Operations

Consider two transactions T and U as defined in the following.

   T: x = read(j); y = read(i); write(j,44); write(i,33).
   U: x = read(k); write(i,55); y = read(j); write(k,66).
  • What is the values of xT, yT, xU, yU, ai, aj, ak if T runs before U?
  • What is the values of xT, yT, xU, yU, ai, aj, ak if U runs before T?
  • Give two serially equivalent interleavings of the transactions T and U. For each of them, also state whether it is equivalent to “T runs before U” or “U runs before T”.

Serially Equivalent and Order of conflicting Operations

Consider two transactions T and U as defined in the following.

   T: y = read(k); x = read(i); write(j,22);
   U: write(i,33); write(j,44);
  • Identify any pair of conflicting operations.
  • Give three interleavings of transactions T and U that are not serially equivalent.
  • Give three interleavings of transactions T and U that are serially equivalent.

Edit - History - Print - Recent Changes - Search
Page last modified on April 11, 2010, at 12:39 AM