Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3

 WriteOperationOrdering

Relational databases often use Referential Integrity (RI)constraints to maintain database consistency. When RI is enabled, database operations must be performed in a specific order that prevents invalid references. If this order is not adhered to then the database will throw an exception rather than let the write succeed.

...

No Format
SELECT * FROM CUSTOMER LEFT JOIN ORDER ON CUSTOMER.ID = ORDER.CUSTOMER_ID WHERE CUSTOMER.NAME = ?'Tuscany'

The resulting data graph will contain all matching customers as well as their related orders. Now assume the application uses the SDO API's to delete some customer from the graph and then also deletes the related orders. Although the application deleted the customer first, the DAS must delete the orders first from the database since deleting the customer, with existing referencing orders, would violate the RI constraints and result in an exception.