3.1.1.2.5 Calculating a DiffGram
A DiffGram is a collection of update, change, and delete commands along with relevant concurrency data. For information about how concurrency is managed, see section 3.1.1.2.2.
A higher-level application makes changes to the RecordSet using the implementation-specific API. The RecordSet tracks these changes on the RecordSet change list. There are three types of commands in a DiffGram:
Insert Command: Instructs the RDS Transport Protocol server to create a new record on the data store with new column data values. Columns that duplicate the keys on the table will fail the insert request at the server.
Data MUST contain the name of the table that the insert command is targeting.
Data values MUST contain a field entry for every column that is marked as IsKey and for every column where IsNullable is set to FALSE.
If the table is a parent table in the RecordSet, this command MUST be encoded as adtgParentInsert (section 2.2.3.14.4.3). If the table is a child table, this command MUST be encoded as adtgChildInsert (section 2.2.3.14.4.7).
Update Command: Instructs the RDS Transport Protocol server to update an existing record on the data store. Changing any column where IsKey is set to TRUE will result in the record identified by the new key being updated.
Data MUST contain the name of the table that the update command is targeting.
Data MUST contain a field entry for every column that is marked as IsKey.
Data MUST not set to TRUE any fields where the column property of IsNullable is already set to FALSE.
Data MUST contain a field for every value that is to be updated.
Data MUST contain a copy of the original value for every field in the updated field list.
If the table is a parent table in the RecordSet, this command MUST be encoded as adtgParentChange (section 2.2.3.14.4.1). If the table is a child table, this command MUST be encoded as adtgChildChange (section 2.2.3.14.4.5).
Delete Command: Instructs the RDS Transport Protocol server to delete an existing record on the data store. The delete command targets the record identified by the key fields where IsKey is set to TRUE.
Data MUST contain the name of the table that the delete command is targeting.
Data values MUST contain a field entry for every column that is marked as IsKey.
If the table is a parent table in the RecordSet, this command MUST be encoded as adtgParentDelete (section 2.2.3.14.4.2). If the table is a child table, this command MUST be encoded as adtgChildDelete (section 2.2.3.14.4.6).
The DiffGram is encoded by:
Writing one adtgParentInsert for each insert command in the RecordSet change list.
Writing one adtgParentDelete for each delete command in the RecordSet change list.
Writing one adtgParentChange for each update command in the RecordSet change list.