01-03-2014 1:21 PM
Hi All,
In which case exclusive locks can be requested several times from the same transaction.
In which situation required multiple time request to lock object in same transaction.
01-04-2014 1:55 AM
01-04-2014 6:30 AM
Thanks Purushotham,
Form your thread also it is telling that exclusive locks can be requested several times from the same transaction.
My question is in which situation it is required to locks be requested several times from the same transaction.
01-04-2014 7:43 AM
Hi Sandeep,
in exclusive lock we have two types.
1)exclusive -cumulative:( only one lock)
An exclusive lock protects the locked object against all types of locks from other transactions. Only the same lock owner can reset the lock (accumulate).
2)exclusive-non-cumulative:(several times from same user)
Exclusive locks can be requested several times from the same transaction and are processed successively. In contrast, exclusive but not cumulative locks can be called only once from the same transaction. Each further lock request will be rejected.
And your doubt is requested several times from the same transaction.
Here transaction means 'User' k.
And several times means ,we can keep the lock for part of the table also.
so if we want keep for same table exclusive non-cumulative will allow.
Regards,
Reddy.
01-04-2014 11:08 AM
to make it short:
locks requested several times from the same transaction
are never required but they don't hurt.
Sometimes you can't know if a required lock has already been set, so you just lockit, possibly again.
Regards
Clemens