Application Development and Automation 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: 
Read only

No queue for SAP locks ?

Former Member
0 Likes
525

In the docs I read:

>Remember in particular that setting too many shared locks without good reason can have a considerable effect on programs that work with database tables. If several programs running concurrently all set a shared lock for the same application object in the system, it can make it almost impossible to set an exclusive lock, since the program that needs to set that lock will be unable to find any time when there are no locks at all set for that object

Does this mean there is no lock queue?

RDBMS lock requests enter a queue: RRRRRWRRRRRWWRRRRRWRRWRWRW

so the only issue is how long you have to wait - not whether it is possible to get a lock

1 ACCEPTED SOLUTION
Read only

Sandra_Rossi
Active Contributor
0 Likes
487

> >Remember in particular that setting too many shared locks without good reason can have a considerable effect on programs that work with database tables. If several programs running concurrently all set a shared lock for the same application object in the system, it can make it almost impossible to set an exclusive lock, since the program that needs to set that lock will be unable to find any time when there are no locks at all set for that object

FireBean500, please don't forget to indicate the references, that makes it easier to answer if we have the context.

So, your doc comes from:

[SAP Library - The SAP Lock Concept - Lock duration|http://help.sap.com/saphelp_nw70/helpdata/en/41/7af4c5a79e11d1950f0000e82de14a/frameset.htm]

> Does this mean there is no lock queue?

> RDBMS lock requests enter a queue: RRRRRWRRRRRWWRRRRRWRRWRWRW

> so the only issue is how long you have to wait - not whether it is possible to get a lock

We use shared locks to keep SAP programs from getting exclusive locks, but I never found a situation where I had to use shared locks, I always used exclusive locks. Most of time, if lock can't be set, we usually make the program fail.

But we may find situations, especially parallel processing, where it is best to to wait for a few seconds in case lock fails. In that case we must program it ourselves (loop on ENQUEUE* function module and WAIT UP TO SECONDS statement).

We may also use the ENQUEUE* _WAIT parameter (5 attempts by default of 1 second wait each, see [Note 6822 - ENQUEUE WAIT does not wait for long enough|http://service.sap.com/sap/support/notes/6822] for more information)

4 REPLIES 4
Read only

Former Member
0 Likes
487

There's no queue for sap locks.!!!!!

Read documentation about sap locks.!

Read only

0 Likes
487

I have

you can see the excerpt above that explains that seems to explain there is no queue

I know the functions are called ENQUEUE DEQUEUE

but I think that refers to the ability to aggregate locks to simplify application design

Are you saying there is a queue ?

Read only

0 Likes
487

certainly that refers to the ability to aggregate locks to simplify application design. But there is not a queue of locks..!

Read only

Sandra_Rossi
Active Contributor
0 Likes
488

> >Remember in particular that setting too many shared locks without good reason can have a considerable effect on programs that work with database tables. If several programs running concurrently all set a shared lock for the same application object in the system, it can make it almost impossible to set an exclusive lock, since the program that needs to set that lock will be unable to find any time when there are no locks at all set for that object

FireBean500, please don't forget to indicate the references, that makes it easier to answer if we have the context.

So, your doc comes from:

[SAP Library - The SAP Lock Concept - Lock duration|http://help.sap.com/saphelp_nw70/helpdata/en/41/7af4c5a79e11d1950f0000e82de14a/frameset.htm]

> Does this mean there is no lock queue?

> RDBMS lock requests enter a queue: RRRRRWRRRRRWWRRRRRWRRWRWRW

> so the only issue is how long you have to wait - not whether it is possible to get a lock

We use shared locks to keep SAP programs from getting exclusive locks, but I never found a situation where I had to use shared locks, I always used exclusive locks. Most of time, if lock can't be set, we usually make the program fail.

But we may find situations, especially parallel processing, where it is best to to wait for a few seconds in case lock fails. In that case we must program it ourselves (loop on ENQUEUE* function module and WAIT UP TO SECONDS statement).

We may also use the ENQUEUE* _WAIT parameter (5 attempts by default of 1 second wait each, see [Note 6822 - ENQUEUE WAIT does not wait for long enough|http://service.sap.com/sap/support/notes/6822] for more information)