Reputation: 580
I need to restrict that multiple users can't edit same record at the same time. Any idea how to do that in vaadin grid, what would be the best approach? I'm using vaadin flow.
thanks
Upvotes: 0
Views: 124
Reputation: 10643
This is not a Vaadin question. This is generic software architecture question.
You need to decide in which layer you will control this. You can rely on optimistic locking on data base layer. This allows Editing being enabled for everybody, but you get exception if someone did it first and then you handle the exception in some manner you like.
You can also create locking mechanism on service / business logic layer. Editing locks the service I.e. allow the editor open if service is not locked, release lock when cancel / save. This is called pessimistic locking.
Upvotes: 1