Referential Integrity in the CML

When a database engine, such as Microsoft® SQL Server™, has built-in support for primary and foreign keys, database-specific rules, and cascading updates and deletes, developers need not create their own code to implement referential integrity (RI). This is the case in the CML, in which many foreign key relationships are designed into the database. Because several RI rules are based on these relationships, they can be counted on to trigger rule enforcement within the database. This reduces the CML's tasks, which enhances both scalability and performance.

Consider the case of an administrator who, while adding a new library item, might try to enter a bar code equal to that of an existing item. The CML could search the database first for that bar code but it doesn't, because in most cases entered bar codes are unique and the search would be unnecessary. Instead, the CML waits for the database to report an error (ODBC returns rich error information), formats and displays that error to the administrator, and prompts for resubmission of the information. Data integrity is maintained, and the CML has additional work only when necessary.