Typical usage scenario
Suppose the server has a component that uses a DataStore called DS_1.
This DataStore is the source of data for a target DataWindow called DW_1 on
the client. In the Activate event, the component connects to the
database, creates a DataStore, and assigns the DataWindow object
to the DataStore.
In one of its methods, the server component issues a Retrieve function
for DS_1, calls GetFullState on DS_1,
and then passes the resulting Blob to the client.
Because the component’s Automatic Demarcation/Deactivation
setting is disabled (the component is stateful), it also calls SetComplete before
the method returns to cause the component instance to be deactivated.
enabled
If the Automatic Demarcation/Deactivation setting
were enabled for the component, it would not need to call SetComplete after
the retrieval because the component instance would automatically
be deactivated when the method finished execution.
Once the client has the DataWindow Blob,
it calls SetFullState to apply the state information
from the Blob to DW_1.
At this point, the user can insert new rows in DW_1 and
change or delete some of the existing rows. When the user makes an
update request, the client calls GetChanges and
invokes another component method that passes the resulting Blob back
to the server. The component method then calls SetChanges to
apply the changes from DW_1 to DS_1.
After synchronizing DS_1 with DW_1,
the server component updates the database and calls SetComplete or SetAbort to
indicate whether the update was successful.
If the update was successful, the client calls ResetUpdate to
reset the status flags on the client DataWindow.
After the completion of the first update operation, the client
and server can pass change Blob results (rather
than complete state information) back and forth to handle subsequent
updates. From this point on, the update process is an iterative
cycle.