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, it also calls SetComplete before the method returns to cause the component instance to be deactivated.

NoteIf Automatic Demarcation/Deactivation were 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.

Figure 24-1: Update processing example

This example graphically illustrates the process described in the paragraphs that precede it. The example shows the client application on the left, the E A Server component on the right, the Blob from D S _ 1 passed to the clent application, and the Blob from S W _ 1 passed from the client. The example assigns numbers to the steps described. The paragraph that follows this example refers to steps 7 through 14. In Step 7, the user modifies data in S W _ 1 and makes an update request. Step 14, deactivate, is the last step n the entire example.

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 that begins with Step 7 and concludes with Step 14.