Add support for member locking - #3409
Conversation
Signed-off-by: Sanjula Ganepola <Sanjula.Ganepola@ibm.com>
Signed-off-by: Sanjula Ganepola <Sanjula.Ganepola@ibm.com>
Signed-off-by: Sanjula Ganepola <Sanjula.Ganepola@ibm.com>
|
馃憢 A new build is available for this PR based on a833dd7. |
|
@codefori/core Before proceeding with more testing of this PR, any major issues with support member locking? |
|
Hi @SanjulaGanepola, In my example I've opened a member from vscode (job 682461/QUSER_NC/QZDASOINIT) and from a 5250 session with the same command: Now, if I change a row and I try to save it, it doesn't work because the member is locked by my other job:
My suggestion is to use EXCLUSIVE_ALLOW_READ instead of SHARED_UPDATE. In this way, we can be sure that no one can steal our lock. Another issue I had is that the object is locked even if I'm not connected anymore: Without Mapepire, my suggestion is to use *THREAD instead of *JOB in lock scope. In this way, when your connection end, the thread is closed and the lock released. But with Mapepire is not so easy, it seams that the lock survive also to the client disconnection. We need to analyze better this issue. Currently, there are no safeguards in place when opening members with defined locks; this means that a user can open a member, attempt to modify it, and then get stuck when trying to save... Ideally, you should check for locks before opening the member, so that it opens in view-only mode if locks already exist. You could manipulate the WRKOBJLCK spool or use the SQL service, but be careful not to make this operation take too long... At the moment I can't see anything related to IFS, anyway I think that also IFS should be covered (IDK idf in this pr or in another one). |







Changes
This PR adds support for member locking using a shared-update lock (
*SHRUPD) that is allocated on reads and deallocated when we close the editor. This is an opt in setting meaning it is disabled by default.This has been requested in #1688 and #2409
How to test this PR
Member Lockingunder theSource Codetab.Checklist