Delete table entry locks
I have tried using the FM ENQUE_DELETE but I keep on not getting the expected result to delete the lock for some table entries.
I noticed that there are different kind of locks and the program that locked those table entries is using lock type 'E'.
Could I set the lock type to 'S' (Shared) so that it is possible for the first program to "lock" the table entries but once the second program is run, it can delete the table lock?
Thanks very much!
The program which first locks the table has usually the type set up. If it is not Your program, You surely are not able and allowed to modify the standard locktype, which was set up, at runtime. As far as I know.
If it is Your program, then You can self define, which lock type You can use.
will tell You about the types and a code sample in the link should provide all information, which You might need.
Ok. I should have pushed through my investigation.
I found a way for this. Through debugging on FMs ENQUE_REPORT/READ/DELETE, I found a way to fetch the foreign locks and have them deleted, making the program assume that the current user is the user who locked the foreign locks. =]
It should never be needed to explicitely delete specific table lock entries manually. Always only use the generated FM enqueue_... and dequeue_... to lock/unlock db records!
- Call ENQUEUE_EZyour_table
- Make your changes to your_table
- Call DEQUEUE_EZyour_table
This will delete the previously created lock entries.
What tables you are using, check for lock objects in SE11 ex: ENQUEUE_ and DEQUEUE_, if available call them before and after OPEN SQL statement if not create a lock object .