java - Prevent user from editing the same record -


i'm developing multiple user application on same network usign mysql & java. i'm looking is: user a: modifying record 100 user b: try view or modify same record 100.

i want application return error message user b, record editing user.

how can this?

include edit_timestamp in tables of database want prevent multiple users updating, you'll update every time edit row.

in forms, include hidden field edit_timestamp value stored in row you're editing.

when receive edit form, check if edit_timestamp of row you're editing hasn't changed. if has changed, has edited row , throw error user. if hasn't changed, update row , edit_timestamp field


Comments

Popular posts from this blog

Change php variable from jquery value using ajax (same page) -

Pull out data related to my apps from Android Play Store and iOS App Store -

How can I fetch data from a web server in an android application? -