Top.Mail.Ru
January 25th, 2007 - Java developers — LiveJournal
? ?

Java developers

January 25th, 2007
Image

02:11 pm - Imagelemmywinks30 - Help please

Here is the scenario:

Let's say I have an java web application that holds employee information. First you have a screen that lists some general employee information: name, hire date etc. Upon clicking one of those names, you get back an edit screen with all employee information.

Lets say user A clicks on employee 1234 and makes a change to their department value to 111 and saves (still on the employee edit screen)

Next, user B comes along and changes department from 111 to 222.

Since user A has not refreshed their page yet, they still see dept as 111, having no idea that userB changed this value.

So userA hits save again, now they have overwritten user B's data!

Is there a way to lock the record in the database (not sure this would be appropriate bc how would you know when the user was done with the data?)or somehow avoid this situation?

Thank you.
Powered by LiveJournal.com
Image