Update Rules

From RemObjects Software

Jump to: navigation, search

This is a Data Abstract Architecture entry
Feel free to add your notes to this topic below.



Data Abstract uses Update Rules to give your server application details control over the order in which updates to different data tables will be applied to the server.

By default, if no update rules are defined, the data abstract service will simply apply all deltas in the order they have been received. This works fine in many scenarios, if the data tables involved are independent. However, if dependencies such as foreign keys or master/detail relationships exist between tables, things become more complicated.

Imagine a typical master/detail scenario with Customers and Orders, where each order is assigned to a particular customer. When a new customer and order pair is added on the client, it is imperative that the customer will be inserted first, before the orders that reference it. Otherwise, inserting of the orders would be rejected by the database, because the foreign key relationship would link them to a non-existing customer.

Conversely, when deleting both a customer and his orders on the client, the reverse logic must be applied, and orders must be deleted before the corresponding customer - otherwise deleting the customer fails because it would again break the foreign key relationship.

Setting up Update Rules

Schema Modeler's Update Rules View provides two ways for configuring update rules. First of all, you can click the "New Rule" button to create a new empty rule, and configure that new rule manually.

More importantly, you can drag tables from the Data Tables Pane over to the Update Rules View, to automatically create rules for specific tables. Dropping a table will give you two options, to create one rule for the table, or to create three separate rules for inserts, updates and deletes, respectively.

By creating three separate rules, you can control the order of inserts, updates, and deletes, separately.

To create rules for the scenario outlined above, follow these steps:

  • Drag and drop the Customers table, and select to create three separate rules
  • Drag the Order table and create one rule
  • Finally, sort the four rules that were created in the order

This configuration will ensure that inserts (and updates) to Customers will happen first, followed by any changes (inserts, updates or deletes) to Orders, and finally followed by any deletes for Customers.


See Also


Product: RemObjects Data Abstract
Current version: Data Abstract 'Vinci' (5.0)

ListsGlossaryFeaturesHow ToDriversComponentsToolsSamplesArticlesArchitectureIssues

Personal tools