SYNCWAIT

About SYNCWAIT

A sync point is a point in time at which all users of the database are out of transaction state. A pseudo sync point is the same as a normal sync point, except that some of the database users might have their transaction state suspended.

The SYNCWAIT DASDL option defines the period of time that DMS II allows a program to be held waiting for a sync point, before DMS II attempts to perform a pseudo sync point.

If a program attempts to enter transaction state, and DMS II requires a sync point, DMS II forces the program to wait. If SYNCWAIT is set, the SYNCWAIT period starts from when the program is forced to wait.

If the SYNCWAIT period completes with the program still waiting, DMS II attempts to force a pseudo sync point.

To force a pseudo sync point, DMS II identifies any other users of the database that are in transaction state, and cause them to perform a pseudo end transaction/begin transaction. DMS II can only do this when the other users of the database issue a DMS II command.

The program that is attempting to enter transaction state, and is being forced to wait, is only allowed to proceed once the pseudo sync point is completed.

Refer to the DMS II Data and Structure Definition Language (DASDL) Manual for more information on the effect of the SYNCWAIT DASDL option.

Impact of Setting SYNCWAIT

In certain circumstances, setting this property provides runtime database performance benefits.

Where you have programs that remain in transaction state for extended periods of time, and that perform regular DMS activity, SYNCWAIT enables you to reduce the wait time of the programs being held waiting for a sync point.

The SYNCWAIT mechanism can only operate if the users of the database perform regular database commands, and do not wait in transaction state for non-database resources. For example, if a program is in transaction state, and is waiting on an operator AX, the SYNCWAIT DASDL option will have no effect.

This means that the program waiting to enter transaction state cannot proceed until the pseudo sync point is complete for all current database users. Therefore, if a current transaction is in transaction state and is waiting for a non-database resource, the program waiting to proceed will still have to wait, as all current database users have not completed the pseudo sync point.

Impact of Not Setting SYNCWAIT

If both SYNCWAIT and MAXWAIT are not set, then whenever DMS II requires to perform a sync point, any program attempting to enter transaction state is forced to wait until all current users have performed a normal end transaction. As the current users perform an end transaction, they are also forced to wait if they attempt to reenter transaction state.

In this situation, you might have multiple programs all waiting to enter transaction state, being held up by a single long transaction.

Refer to MAXWAIT for more information.

Recommendation for SYNCWAIT

It is recommended that you set the SYNCWAIT DASDL option, as this can provide performance benefits. To benefit from SYNCWAIT, ensure your programs do not wait for non-database resources while they are in transaction state.

Common examples of non-database resources are:

Setting SYNCWAIT for an application

The DMS II DASDL option SYNCWAIT is set for the DMS II database of your application by entering a non-zero numeric value in the Sync Wait Segment configuration property in Developer.

To set the SYNCWAIT option for an application, on the Global Database DASDL Options screen, enter the period of time in the SYNCWAIT property. Input is in seconds, to a maximum of 99999 seconds.

If you enter 0 (zero), the SYNCWAIT DASDL option is not set. By default, the value is 0 (zero).

If the SYNCWAIT DASDL option is set, it can be altered at runtime.