Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Exclusive Lock

Former Member
0 Kudos

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.  

4 REPLIES 4

Former Member
0 Kudos

This message was moderated.

0 Kudos

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.

0 Kudos

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.





0 Kudos

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