Multiple Users editing same object - info message

Hello guys,

i just searched through the existing posts, but couldn’t find anything heplfull.

Following Scenario:
We have User A and B. User A opens the Order-Browser Screen and opens an object in Order-Editor. Now User B wants to edit that very Same Order Object. Is there a way to at least show a message to user B, when opening the Editor. something like “User A is currently editing this object”. i could also then go ahead and send the editor screen in an “Read-Only” mode or something like that.

Where/how do i get the information in my editor screen, if someone is currently editiing this object?

Thanks and Best Regards
Daniel

hi,

what you are searching for are the different locking solutions. CUBA offers both pessimistic locking as well as optimistic locking. Optimistic locking is the default (and this is totally reasonable for normal use cases).

But as in the docs described, you can also leverage pessimistic locking to accomplish your described behavior.

Bye
Mario

2 Likes

Hello Mario,

Thats exactly what i was looking for. Setup pessimistic locking for some entities. Works great.

Thanks
Daniel

hi,

as I thought that this example is quite interesting and not very well represented in the docs - therefore i made a small blog post on this topic:

The example can be found at github: GitHub - mariodavid/cuba-example-concurrent-usage-prevention: CUBA example that shows how to use CUBAs different possibilities to prohibit concurrent usage of resources.

Bye
Mario

1 Like