Kibana Custom Visulaization Session Object

Hello Team,

I am working on a use case wherei had to update the documents. i have created a custom plugin with EUIBasic Table , selection option.
Now, i want to handle multiple users trying to update the same record. could you please help me understand is there any session object which i can use to identify records are already selected by some other user.

Here is an example of use case

User 1 -> opens UI and selects records 1,2,3 for update
at the same time user 2 opens UI
User 2 -> opens UI and selects records 1,2,3 for delete
and before user1 click update user 2 deletes records and now user 1 updates the same records.
so i want to achieve something like when user1 selects records and trying to work on them so noo other user should be able to select the same records as they are already selected, can we put those in some place which is common for all users.

Kibana Version : 6.7 and 7.2

Thank you for your help and support,
Adity

Hello Team,

I think I found a way to handle concurrency through locking mechanism provided by elastic.

Thank you,
Aditya

Glad you found the solution. Plz post it so that other users can benefit as well.

Thanks
Rashmi

Hello Team,

As explained in Solving Concurrency Issues , i am thinking of creating a transaction

user 1 logs in opens UI -> get lock using API
PUT /fs/lock/<index_name>/_create { "lock_type": "exclusive" }

user1 will perform operations like update/delete etc

and releases lock using API
DELETE /fs/lock/<index_name>

If any other user logs in and tries to access the UI the lock API will try to acquire the lock on the same index but will get error since other user has already acquired an exclusive lock(Checked this by executing APIs from Kibana Dev Tools).

To test the scenario i need to implement it Kibana custom visualization, to understand how can i execute lock APIs using CallWithRequest Client, I have opened a new topic [here](How to call lock APIs using call with request

Thank you,
Aditya