multi-user application record locking – best method? Ask

Questionsmulti-user application record locking – best method? Ask
Christian asked 2 years ago

Hi,

I am building a web-app that allows several users to perform read and write-operations on the same table. What is the smartest way of preventing that a record in the table is simultaneously edited by different users (ie. changes from user A get overwritten by user B without any of users noticing the conflicting behaviour)?

Thanks!
C

2 Answers
Abu Ghufran answered 2 years ago

Hello,

I have not tested this scenario before.
I'll let you know after some research on jqgrid available events.

Abu Ghufran answered 2 years ago

If you can limit with dialog editing, you can use following events of edit dialogs.
afterShowForm and onClose. You can make a custom ajax call in JS function to set lock field of edited row id.

Plus, you need to set "rowactions"=>false to disable inline editing.

Demo usage here: https://gist.github.com/gridphp/a8598a323d7e06ed53a5a897b7c58f64

Your Answer

3 + 0 =

Login with your Social Id:

OR, enter

Attach code here and paste link in question.
Attach screenshot here and paste link in question.



How useful was this discussion?

Click on a star to rate it!

Average rating / 5. Vote count:

We are sorry that this post was not useful for you!

Let us improve this post!