Correct implementation of Lock - Update - Commit(ifneeded) - Unlock (LUCU) in processes

If an edit is split into seperate Lock - Update - Commit(ifneeded) - Unlock (LUCU) steps in a process this can lead to locked records, when the unlock is not performed. This can occur due to errors in the process, between the lock and the unlock.
These record locks can have impact on the performance.
Unlike the Edit, which unlocks the record in case of an error, a self-built LUCU process will not unlock.
When building a LUCU process, unlocking the locked record needs to be build-in on each step an error could occur.

For example, whe have a process with an Edit


This is now split into a LUCU process

If we expand the Error handling for the Update record and the Commit record we will see there is no Unlock. So if an error occurs here, the record remains locked.

To unlock the record we need to add Unlock record here as well

Same will be if we add (optionally consumed) processes in between the Lock and Unlock record. Also here there is no Unlock

The Unlock record has to be added in every Error handling - success = false branch manually.

6 Likes

Hi Stefan,
Thanks for this post, it makes sense but never thought of this.
To be honest this seems like extra manual extra work that is easily forgotten.
Wouldn’t it be possible to have these unlocks handled in the standard error handling by the platform (assuming that you always want to unlock after something goes wrong)?
I understand this is different than edit and with lucu you have more control in the process but looking at a few Novulo components with lucu I do not see this approach being used very often so it may lead to unnecessary locks. I also understand it may be difficult to determine which record(s) to unlock but just wondering what the possibilities are.

1 Like

An internal service request was already made for this, but till implemented (if even possible) adding unlocks manually will be the best practice.

If functionallity will be implemented, I will update this post.

1 Like