Javascript is single threaded, so you can just mark them as clean just before you send them. IOW. It won't be possible for them to be updated between when they are marked as clean, and when the call to save starts.
If the save fails, just mark them back to being modified. Note: During the save process on the server, they can be modified. On Mar 24, 4:19 am, Martin Larsson <martin.liste.lars...@gmail.com> wrote: > We're experimenting with background saving in our GWT-app. IOW. we > mark objects as 'modified', and then at regular intervals, find all > modified objects and pass them to the database for storage. The > question is when is it safe to mark the object as 'clean'. The on- > success-handler of the save()-method is too late, obviously. That can > happen any time later and the user might have modified the object(s) > again. As the status also can be 'new' or 'deleted', I need to pass > the status to the server so it knows what to do. IOW. I can't mark the > object clean too early. What I'd like is to mark them 'clean' when > they're safely serialized, and have the on-failure-handler set them > back to 'modified' if the save() failed. > > So ... is there any point in the code where I can be certain that the > objects are serialized and on their way to the server so I can start > modifying them in the client without interfering? > > Figure 4 here:http://eclipse.dzone.com/news/making-gwt-remote-procedure-ca > indicates that the objects are safe once the method in *Async returns. > Is that safe? > > M. -- You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To post to this group, send email to google-web-toolkit@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.