3.3.5.5 Synchronize Event Processing

The server receives an rdsSynchronizeRequest message from the client. The server will process out the parameters and fashion a call to the Synchronize method. The parameters are processed according to the algorithm described in section 3.3.1.2.<84>

The RDS Transport Protocol server Synchronize method MUST go through the TableGram and for each update request in the TableGram apply the algorithm detailed in section 3.3.1.2 to determine if the update is an active or stale update. If the update request is a stale update, this SHOULD be noted in the rdsStatusArray return parameter (see section 2.2.3.13.10). If the update is active, the update SHOULD be sent to the data store.

For each insert message in the TableGram, the RDS Transport Protocol server MUST execute a SQL command on the backend database to insert the new record. If the backend data store returns an error, the RDST server MUST note this in the rdsStatusArray.

For each delete message in a TableGram, RDS Transport Protocol server MUST execute a SQL command on the backend database to delete the requested record. If the backend data store returns an error, the RDST server MUST note this in the rdsStatusArray.

The RDS Transport Protocol server SHOULD<85> do all of the above in a single transaction.

The RDS Transport Protocol server MUST then construct an rdsSynchronizeResponse message. The contents of the rdsSynchronizeResponse are sent back to the client in the reply. The form of the rdsSynchronizeResponse depends on the form of the rdsSynchronizeRequest received, as follows.

Request received

Response sent

rdsSynchronizeRequest5Args

rdsSynchronizeResponse5Args

rdsSynchronizeRequest6Args

rdsSynchronizeResponse6Args

rdsSynchronizeRequest7Args

rdsSynchronizeResponse7Args

If the client sends the server an rdsOptionalStatusArray or rdsOptionalLastArgStatusArray containing VT-EMPTY instead of an rdsStatusArray, the server SHOULD respond with an rdsOptionalStatusArray or rdsOptionalLastArgStatusArray containing VT-EMPTY instead of an rdsStatusArray. However, if the client sends the server an rdsOptionalStatusArray or rdsOptionalLastArgStatusArray containing an rdsStatusArray, the server MUST respond by populating the rdsStatusArray in the rdsSynchronizeResponse according to the rules described above.