Details
-
Improvement
-
Status: Closed
-
Major
-
Resolution: Fixed
-
3.0
-
None
Description
Currently, when an object is committed in three tier environment from the client, the PK is returned to the client. However with the possibility of other changes being made to that object in Lifecycle callbacks, the client will be left with a stale copy of the object. I see three solutions, from simplest to most complicated:
1. after every commit on the client, mark the object as HOLLOW. Although this will generate a little more traffic sometimes, it is probably not significant in most workflows.
2. return a flag from the server if the object was touched in a lifecycle event. This then sets HOLLOW on the client.
3. return the diff of changes to the object to the client
Although at first glance (3) looks like it might be most efficient, it actually may not be. In many cases the developer discards a context immediately after committing the data in it, in which case the diff was returned unnecessarily. This is our situation since our list views use a shared context (read only) and each edit view creates a new specific editing context which is discarded upon save and closing the window.
Others might have different workflows.