Types of log writes
Log writes are divided into two categories: asynchronous and synchronous.
Asynchronous writes
Asynchronous writes are the most common. These asynchronous writes occur when data is updated. Before, and after, image records are usually moved to the log output buffer, and control is returned to the application. However, if no log buffer is available, the application must wait for one to become available.
Synchronous writes
Synchronous writes usually occur at commit time when an application has updated data. This write is called 'forcing' the log because the application must wait for Db2 to force the log buffers to disk before control is returned to the application. If the log data set is not busy, all log buffers are written to disk. If the log data set is busy, the requests are queued until it is freed.
Two-phase commit log writes
Because they use two-phase commit, applications that use the CICS®, IMS, and RRS attachment facilities force writes to the log twice. The first write forces all the log records of changes to be written (if they have not been written previously because of the write threshold being reached). The second write writes a log record that takes the unit of recovery into an in-commit state.