When Update is issued on the client, DataObjects for .NET first collects all modified simple table rows. Further processing depends on whether it is a 2-tier or a 3-tier configuration (see Application Configurations):
- In a 2-tier client (classic client-server configuration, that we also call a direct client), the client itself performs database updates. It generates SQL statements updating the database and sends them to the database server for execution. If you need to customize the update process, your business logic code can handle the C1TableLogic BeforeUpdate /C1TableLogic AfterUpdate events. These events fire for each modified row. The C1DataRow object passed to the event handler is a modified data row of the same client data set.
- In a 3-tier configuration (distributed application), there are two identical instances of your data library participating in the process: one on the client and one on the server, see Application Configurations for details. An update request on the client sends the modified rows to the server. On the server, the server instance of your data library (having the same business logic code) takes over. It reconstructs a data set from the modified rows and then performs the update: generates SQL statements updating the database and sends them to the database server for execution. If you need to customize the update process, your business logic code can handle the C1TableLogic BeforeUpdate/C1TableLogic AfterUpdate events. These events fire for each modified row. The C1DataRow object passed to the event handler is a modified row received from the client. It belongs to a C1DataSet reconstructed on the server (we call it the server data set). The server data set does not include all rows that were originally fetched to the client. It only includes modified rows and those related to them through relations. Other than that, the structure of this data set is identical to the client data set. The server data set exists for the duration of serving the update request.