Hi Han
I have seen no evidence of any platform based record locking mechanism to prevent one user overwriting another's changes if they are editing simultaneously - perhaps someone from Mx can confirm?
However, in the past I have added this sort of functionality through workflow. Basically, write to a linked lock record table when a record is opened, and clean up the lock record when closing a form. Then when a user tries to open a form, check for an existing linked lock record, and if it exists open a read-only view of the data with a warning giving the name of the user who is currently editing the record. HTH
Maybe it can be solved in the community commons package in a generic way, I posted an proposal here:
https://forum.mendix.com/questions/1511/Community%20Commons%20Module#2748
On another platform (BMC Remedy ARS) this is solved in the following way:
Off course this still needs locking during the transaction with some kind of SELECT FOR UPDATE, but it shortens the overlaptime dramatically from users having records open for minutes (or longer) to the sub-second level.
I have an enhancement request issued at Mendix for this function, allthough to be precise, I've asked for a function IsModifiedByOtherUser(), so I can determine myself what should happen.