SQL programming / SQL portability |
Understanding concurrent data access and data consistency.
Data concurrency is the simultaneous access of the same data by many users. On the other hand, data consistency means that each user sees a consistent view of the database. Without adequate concurrency and consistency controls, data could be changed improperly, compromising data integrity. To write inter-operable applications, you must adapt the program logic to the behavior of the database server regarding concurrency and consistency management. This issue requires good knowledge of multiuser application programming, transactions, locking mechanisms, isolation levels and wait mode. If you are not familiar with these concepts, carefully read the documentation of each database server which covers this subject.
Processes accessing the database can change transaction parameters such as the isolation level. Existing programs might have to be adapted in order to work with this new behavior.
The following is the best configuration to get common behavior with all types of database engines:
Remarks: With this configuration, the locking granularity does not have to be at the row level. To improve performance with IBM Informix databases, you can use the LOCK MODE PAGE locking level, which is the default.