ColdFusion 9.0 Resources |
Sending data to the serverThe client SyncManager object tracks all the changes to the local data that happens through the session, so that the local data and server data can be synchronized. The SyncManager also tracks the old data instances when data that is already on the server is updated locally. When the AIR application calls the Session.commit method,
all changes that happened on the session are passed to the CFC sync
function. The sync function determines if there are any conflicts
between the returned information. If there are no conflicts, it
updates the server data source. Otherwise, it handles the data as
described in Conflict management.
Note: When you call the session.commit method,
if the server does not throw an error, the commit method dispatches
a CommitSucces event. This event indicates that the session.commit
method has executed successfully, and the client data has been handed
to the server CFC sync method. (If an error occurs while sending
data to the sync method, the client receives a CommitFault event.)
Therefore, the CommitSucces event does not mean that the server
has saved the client data, but only that it has received the data.
For example, the server does not save the data if there is a conflict,
but the CommitSucces event is still dispatched. You handle conflicts separately
by adding an event listener on the SyncManager. The event Flow is
the first to get the CommitSucces event, and then a ConflictEvent
event.
|