‎2009 Apr 01 4:48 PM
Hi All,
I have one doubt...Iam updating the Table using UPDATE statement..is it mandatory to use Table locking befoe updating the table.
For DELETE..no need to use table locking..iam sure but for UPDATE is it required or not. Please help me..
Since iam facing the issues with table locking i posted this one.
‎2009 Apr 01 4:52 PM
HI,
For every database operation you require to have the locking system . When you are updating or modifying the database record then at the same time no one should try to modify this data so in this case you need to lock the entry.
Even in case of Delete if some one is trying to modify the same entry which you deleting.. so to overcome this you need to have locking.
‎2009 Apr 01 7:02 PM
hi sreehari,
Table locking is important before updating or modifying ir deleting the record.
because if some is opened table maintainence view for that table the record if you want to delete or update or modify it will not work.
so if it is a custom table create lock object for primary key field
E_(custom table name)..
Automatically it creates two function modules with name 'ENQUEUE_(lock object created) &'DEQUEUE_(lock object created).
-
so when ever you update for delete the particular record
use CALL FUNCTION 'ENQUEUE_(lock object created) "To lock record
-->then delete or modify
Use CALL FUNCTION 'DEQUEUE_(lock object created) "To unlock Record.
Regards,
Prabhudas
‎2009 Apr 01 7:45 PM
If there is no possibility of someone else accessing a table entry when you are updating, there is no need to lock.
Rob
‎2009 May 25 2:47 PM
Hi Sreehari,
Try this to lock the rows. The rows are unlock after do commit.
SELECT SINGLE FOR UPDATE *
INTO wa_table
FROM table
WHERE ......
AND ......
AND .......
Hope this information is help to you.
Regards,
José
‎2009 May 26 1:45 AM
generally we are locking ztable entries before doing updation for avoiding inconsistancy. lock applicable depending upon table utilization in business point of view.
Good porgrame manner is to lock the table before doing updation activity.
create lock object for your ztable and call lock module(ENQEUE AND DEQUEUE) within your application program. or call FM ENQUEUE_E_TABLE for locking ztable without creating lock object.
Regards,
Peranandam