ComponentOne DataObjects for .NET
Events on Updating Database
DataObjects for .NET (Enterprise Edition) > Business Logic > Business Logic Events > Events on Updating Database

All business logic events described in the previous sections are client-side events; they are fired on the client. The update events listed in this section are server-side events, that is to say, they are fired on the server. You do not need to write a different program to support this client-server division. Your business logic acts as a whole, you do not need to divide it, it all resides in your data library. The same data library is used both on the client and on the server. DataObjects for .NET manages the distinction between client and server and their interaction automatically, transparently to the developer. However, you must be aware that the database update process, and hence the update business logic events, take place on the server, not on the client. Because the data existing on the server is different from that existing on the client, only changed rows and rows related to them exist on the server, see Update in 2-Tier and 3-Tier Configurations. For more details about DataObjects for .NET data libraries, their client and server use, see Application Configurations.

Note that this distinction between client and server does not apply to a direct client application (see Application Configurations), that is a 2-tier application updating the database directly from the client, an application where C1SchemaDef and C1DataSet components reside on the same design surface. In this case, the client and the server are one and the same application.

Update events are special also in the sense that controlling the order of actions using the ExecutionMode property, as described in Action Order and Execution Mode, is not available for update events. Update events are triggered without an action context stack. They are always handled in the default execution mode ExecuteImmediately.

Business logic inheritance levels apply to update events in the same manner as to other DataObjects for .NET business logic events. You can handle update events on any suitable level: on a simple table level, composite table level, table view level, and so on. For more information, see How Business Logic Works on Different Levels.

Before updating the database, DataObjects for .NET fires the BeforeUpdate event. When the database update is finished, it fires the AfterUpdate event. The AfterUpdate event is fired after both successful and unsuccessful updates.

When updating database rows, DataObjects for .NET fires the BeforeUpdateRow and AfterUpdateRow for each row that it changes in the database.

See Updating the Database for detailed explanation of the update process and of the role of the events in it.