I developed ejb3 application using netbeans, My application contain data update form(customer). Customer index is auto increment(but I create it manually). In my application users able to update same recode( same customer id) simultaneously, but it's wrong I want to stop that case, how can i do it using ejb3.
You can use optimistic locking (see @Version) so the user that comes first can update, the second one gets an exception when trying to store his changes.
Both users can read and edit, but only the first can save. Should be your preferred way when concurrent editing does not happen too often.