I have an application server that sends an array of record data to the client in response to a search. Prior to sending the data to the client, my thought is to have the server store the data in a session variable.
When the user selects and then submits a record to edit, the client sends the entire record to the server. It updates the entire the record in the database (in case some other user has committed an update after they have searched).
However, I still need to capture the changes so that I can properly store audit information. I think it s best to capture old and new values based on what the user saw and changed. Therefore, I plan to (deep) compare field by field the record in the session data and the updated record sent by the client. I have two questions:
1) Are there pitfalls/problems with this approach?
2) If not, what is a good Java utility/library for comparing objects?
Thanks in advance for your help.