multi-user application record locking – best method? Ask

Questionsmulti-user application record locking – best method? Ask
Christian asked 3 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 3 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 3 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

2 + 20 =

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 0 / 5. Vote count: 0

No votes so far! Be the first to rate it.

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

Let us improve this post!

Tell us how we can improve this post?