Previous  Next          Contents  Index  Navigation  Glossary  Library

Read Consistency

Certain tasks require a database lock in order to guarantee a consistent read. For example, discrete job information and inventory quantities require a lock on the inventory transactions table in order to guarantee a consistent read. Consider the situation where you have a subinventory with a quantity of 100 units, and a discrete job for 25 units. Between the time the Snapshot reads the inventory information and the time the Snapshot reads the discrete job information, 10 units are completed from the job. The Snapshot needs to guarantee that it populates the MRP tables with inventory of 100 and discrete job quantity of 25, or inventory for 110 and discrete job quantity of 15. Because each task may be processed by independent processes, the Snapshot cannot guarantee that both tasks are executed at the same time. Therefore, by locking the inventory transactions table, the Snapshot guarantees a consistent read.

One of the advantages of the Memory-based Planning Engine is its ability to get a consistent image of all planning data without locking users out of the system. The planning engine accomplishes this with the ORACLE RDBMS feature called "set transaction read-only". With this option, you do not need to lock tables for the duration of the planning run. The Memory-based Snapshot and Snapshot Workers capture all supply and demand data as it existed after a snapshot of the item list has been taken. All changes made to the data after that are not included.

The advantage in using the read-only option is that you do not need exclusive table locks, which lock users out of the table for the entire duration of the Snapshot. Instead, you simply co-ordinate the snapshots performed by the Memory-based Snapshot and Snapshot Workers. Since the collection of data is performed by multiple processes, the "set transaction read-only" feature has to be executed at the same time by the Memory-based Snapshot and Snapshot Workers.

You can achieve two degrees of read consistency under the Memory-based Planning Engine. Set the Snapshot Lock Tables field (Plan Options window) to Yes. This forces the Snapshot Workers and the Memory-based Snapshot to execute the set transaction feature simultaneously. It also ensures that no transactions are performed while the snapshot processes are trying to set the transactions to read-only. To ensure this, the Snapshot Monitor gains an exclusive lock on the tables and instructions the Memory-based Snapshot and Snapshot Workers to execute the set transaction feature. As soon as the Snapshot Monitor receives confirmation from the snapshot processes the set transaction feature is complete, it releases the lock. In this way, you get a read-consistent snapshot with little time spent locking users out of the system.

Locking tables gives you the highest degree of data consistency, but you cannot perform any transactions while this lock is on. If you set the Snapshot Lock Tables field to No, the Snapshot Workers and the Memory-based Snapshot may execute the set transaction feature at different times. There is a remote possibility of some inconsistencies with this method. The Memory-based Planning Engine gives you much better results when compared to the Standard Planning Engine. See also Read Consistency.

See Also

Phases of the Planning Process

Processing Steps

Processes

Snapshot Tasks

Interprocess Communication

Configuring the Memory-based Planning Engine

Enabling the Memory-based Planning Engine

Parallel Processing


         Previous  Next          Contents  Index  Navigation  Glossary  Library