Chapter 6. Data Concurrency

Data integrity is the primary concern in any database environment. The database server must guarantee the integrity of the data as it is modified. Every executable SQL statement that is issued is considered to be part of a transaction.

A transaction contains at least one SQL statement. Multiple SQL statements can be grouped together and executed as a single transaction. Any data that has been accessed or modified by SQL statements will be tracked by DB2 and either permanently changed (committed), or returned to their original state (rolled back). This all-or-nothing behavior is known as atomicity. A transaction does not only guarantee atomicity, it also guarantees durability. Durability is provided through transactional logging. The log files are used to ensure that all committed transactions are physically applied to the database.

A transaction is started implicitly during the processing of the first SQL statement. The transaction is completed when a COMMIT or ROLLBACK statement has been issued, either explicitly or implicitly.

When the data has been permanently changed using the COMMIT or ROLLBACK statement, a point of consistency is established. A point of consistency is important because it is used during database crash recovery and roll forward recovery. In Data Objects and security, we discuss data access control. The GRANT and REVOKE statements can be used by users to provide and take away the ability to access tables, views, and packages. After access control has been established, resource control must be considered. Concurrency problems can occur if resource control is not properly managed.

DB2 provides mechanisms to manage resource control, which are discussed later. The accuracy of the data is based on the correctness of the input and the extent to which data modification is controlled. The correctness of the input data needs to be monitored by the database administrator. DB2 provides some mechanisms to avoid incorrect data entry, including triggers, check constraints, and referential constraints.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.222.22.9