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

Lock objects

Former Member
0 Likes
629

Hello All,

I am using the enque and deque function for a data dictionary table. I have some doubt how to use these functions:

CALL FUNCTION 'ENQUEUE_E_TABLE'

EXPORTING

tabname = table_name

EXCEPTIONS

foreign_lock = 1

system_failure = 2

OTHERS = 3.

here after locking the table...can i use this statement:

INSERT INTO table_name VALUES l_log. <--l_log is defined as l_log like table_name.

than after inserting I can release the table as follows:

*----


Unlock Table

CALL FUNCTION 'DEQUEUE_E_TABLE'

EXPORTING

tabname = table_name

Is this the right way of doing things?

Secondly, I want to know , that what happens to other user trying to access this table while i locked this table down. Will they lose the data or they need some sort of loop to find if the object is free to use?

Thanks for the help.

Note: I asked this question before as well...for some reason, I can not see that question under the option of your question on the right top corner of the screen when you logged into your profile...any ideas on this as well....Thanks.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
606

hi,

yes its the way to do

no user can use the table

data will not be lost

regards

5 REPLIES 5
Read only

Former Member
0 Likes
607

hi,

yes its the way to do

no user can use the table

data will not be lost

regards

Read only

Former Member
0 Likes
606

Hi,

Yes its correct.

Thanks,

Sri.

Read only

Former Member
0 Likes
606

Answer to you 1st question would be...

Yes.. you are doing the right way.

Answer to your 2nd question would be

When you create your Lock Object define your key fields, so that, any other person with the same key cannot insert or update the record.

Select exclusive lock mode, that is the locked data can only be displayed and edited by one user.

Hope this helps.

Vinodh Balakrishnan

Read only

0 Likes
606

well, the problem with lock objects and the enqueue/dequeue technique is that - basically it does not work as it should.

The table entries that you have locked using ENQUEUE can easily get modified by another program/user/even client using some other program, which does not check whether these entries have been locked or not.

ie as long as there is any program directly modifying your table without calling ENQUEUE first, you can never guarantee that your entries wont get modified by someone else, even when you lock them.

Read only

Former Member
0 Likes
606

thanks for all the replies...