Degree 0
A degree 0 transaction does not overwrite the dirty data of other transactions. In terms of locking protocols, degree 0 requires obtaining a (possibly short) exclusive lock on any data the transaction writes. Degree 0 consistent transactions are unrecoverable since they commit outputs before the end of the transaction.
A degree 0 consistent transaction always obtains an exclusive lock before writing.
Degree 1
Degree 1 consistency does not overwrite the dirty data of other transactions also do not commit any writes before the end of the transaction. This requires setting a long (held until the end of the transaction) exclusive lock on any data it writes.Thus transaction T does not make any of its update visible before it commits.
Degree 2
In addition to the requirements for degree 1 consistency, it does not read the dirty data of other transactions. To achieve this it sets a (possibly short) share lock on any data it reads.
Degree 3
A degree 2 consistent transaction may read two different (both committed) values if it reads the same entity twice. A degree 3 consistent transaction takes long exclusive locks on any data it writes, and long share locks on any data it reads.
No comments:
Post a Comment