Monday, April 18, 2016

Teradata HUT lock vs Transaction lock

If we consider these locks only from blocking perspective then behavior of HUT lock and Transaction Lock are same.
  1. For example, 

  2. 1) A read lock prevents another job from claiming a write lock or exclusive lock. 
  3. 2)A write lock prevents a read lock, write lock, or exclusive lock. 
  4. 3) An exclusive lock prevents any other type of lock. 

  5. Conflicting HUT and transaction locks on an object block each other, just as if both were transaction locks or both were HUT locks. 
The two differences between transaction locks and HUT locks are: 

           A transaction lock exists only for the duration of a transaction; after the transaction completes or is                    aborted, the lock is released. A HUT lock is more permanent. It is only removed if an explicit                            RELEASE LOCK command is issued, or if the locking operation completes successfully 

           Transaction lock has session scope
           i.e. it applies to any command submitted by the session running the locking transaction. Another session            running against the same object(s) must claim its own locks, even if it is running under the same user 

           HUT lock has users scope
           i.e. it applies to any Teradata ARC operation that the user is performing on the object. A user must have            only one HUT lock against an object at a time. The HUT lock allows any Teradata ARC operation from            that user to access the locked object(s), but blocks other users from acquiring a conflicting HUT lock on            the object(s). 

No comments:

Post a Comment