‎2008 Jan 03 2:42 PM
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.
‎2008 Jan 03 2:46 PM
hi,
yes its the way to do
no user can use the table
data will not be lost
regards
‎2008 Jan 03 2:46 PM
hi,
yes its the way to do
no user can use the table
data will not be lost
regards
‎2008 Jan 03 2:50 PM
‎2008 Jan 03 2:51 PM
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
‎2008 Jan 03 3:02 PM
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.
‎2008 Jan 03 2:59 PM