Q51626 What do you mean by Weak Level of Consistency?

Answer:

The protocols such as strict two phase locking protocol restricts concurrency while transactions are being execution. Can we allow more concurrency by compromising on correctness/ accurateness, which now needs to be ensured by database programmers rather than by the DBMS? We can operate on weak levels of consistency using the following mechanism:

1.    Degree-two Consistency

Degree-two consistency differs from two-phase locking in that S-locks may be released at any time, and locks may be acquired at any time, however:

  1. X-locks must be held till the transaction has ended
  2. Serialisability is not guaranteed. The programmer must ensure that no erroneous database state will occur.

One of the degree two-consistency level protocols is Cursor stability. It has the following rules:

  1. For reads, each tuple is locked, read, and lock is immediately released
  2. X-locks are held till end of transaction.

2.   Weak Levels of Consistency in SQL

SQL allows non-serialisable executions:

  1. Serialisable is the default.
  2. Repeatable read allows only committed records to be read, and repeating a read should return the same value (so read locks should be retained). (However, the phantom phenomenon need not be prevented) that is, T1 may see some records inserted by T2, but may not see others inserted by T2.
  3. Read committed same as degree two consistency, but most systems implement it as cursor- stability.
  4. Read uncommitted allows even uncommitted data to be read. This is the level, which has almost no restriction on concurrency but will result in all sorts of concurrency related problems.
ed010d383e1f191bdb025d5985cc03fc?s=120&d=mm&r=g

DistPub Team

Distance Publisher (DistPub.com) provide project writing help from year 2007 and provide writing and editing help to hundreds student every year.