'SAPUI5 multiple users working on one table entry

I'm currently developing an application in the SAP BTP for multiple users. In the application you have one table where all responsibilities of a specific task are written down. These responsibilities may overlap between the users, which means that for one responsibility multiple users are mentioned.

In the application the users should click on either accept or reject if they still are responsible for this task. After they have given their feedback, they can click on a save button to write everything via a batch submit to the hana db. If they are not responsible anymore their name should be removed from the tasks and they should not see this task anymore.

The problem I am facing is that currently everything is stored in one database table and if one user gives feedback to some entries while another user works on the same entries, the user who saves his entries last will override the first one.

I have tried searching for a delta insert into the database or to live update after each user input or to lock the data when another user is currently working. But none of these seem to work fine, because users would still be able to override each others entries or they may lock some entries forever.

My question therefore is, what is the usual approach to manage multiple user inputs on a single table or is using a single table a bad practise at first?

My second question would be if sapui5 supports this approach or if I can handle this in another way?



Solution 1:[1]

You need to do server-side validation, before the save action.

UI5 does not support this directly, you can handle it by yourself.

Solution 2:[2]

Because we are stateless with ui5 / data you could use the draft concept https://experience.sap.com/fiori-design-web/draft-handling/

Or something like already said backend logic with checks before safe.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 York Chen
Solution 2 Richard