ComponentOne DataObjects for .NET
Updating the Database
DataObjects for .NET (Enterprise Edition) > Updating the Database

Transparency of database updates is one of the main power features of DataObjects for .NET. DataObjects for .NET solves the problem of updateable views and performs database updates automatically. For more information, see How the Data is Modified. Developers do not have to write server-side code updating the database. DataObjects for .NET can achieve this because it stores data internally preserving the original database structure, so it always knows what modifications must be applied to every database table. For more information see Structured Data Storage: Tables and Table Views and How the Data is Modified.

Although you can rely on DataObjects for .NET to perform database updates and do not have to write code, it is important to understand how the process of updating the database works. It may require customization for special application needs, and it is often necessary to specify business logic code resolving potential conflicts when different users concurrently modify the same data.

Before updating the database, DataObjects for .NET collects all modified simple table rows and sends them to the server for update (commit). Note that simple table modifications are sufficient for the update process. Composite tables and table views do not participate in update. Every data modification made by the end user ends up in a specific simple table, modifying a certain simple table row. Knowing the data structure, DataObjects for .NET tracks all modifications to their destination simple table rows, so in the end only simple table rows must be sent to the server for update. For more information, see Structured Data Storage: Tables and Table Views and How the Data is Modified.

For instance, considering the Customer-Orders-Employees example in Structured Data Storage: Tables and Table Views, the user could modify some rows of the CustOrders composite table (for example, using a grid control showing the combined customer-order-employee information), and also add and delete some rows. Since CustOrders is a composite table, it means that some Customers rows could have been modified, as well as some Orders and some Employees rows. Also, other modifications to these simple tables can be made in the same session as well, via other table views. All these modifications are just modified rows of the simple tables. Therefore, DataObjects for .NET already knows what database table rows must be modified, added or deleted to commit this transaction. It goes to the server and does just that, applies the modifications to the database tables Customers, Orders and, Employees. The rest of this chapter will be devoted to the process of applying modifications to database tables.

See Also