The Application Timer

Previous Next

See Also

The application timer (USCLOCK.EXE) can be run continuously against the USoft Developer-built application. The timer keeps the T_APP_TIME table synchronized with the database time by incrementing it at fixed intervals. After each increment and the execution of the constraints that are evaluated by the increment, the application timer commits the transaction. The application timer rolls back the transaction and stops if it encounters a violation as a result of an increment.

The application manager should ensure that only one instance of the application timer is running against a T_APP_TIME table.

The application timer contains an instance of the USoft Rules Engine. When USCLOCK.EXE is started, it reads the constraints from the repository or from flat files. For this reason, you must stop and restart the timer when you have changed the constraints on T_APP_TIME.

When the application timer is started, it first checks the current record in T_APP_TIME. When the application time is too far behind the database time, it reports an error and aborts. Otherwise, the application timer will quickly update the application time to synchronize it with the database time. In this way all intermediate updates are performed as if the timer had been running all the time. This is important to remember when the application timer is restarted after it has stopped, for example, because of a violation that occurred.

By default, the application timer continuously displays the current time. This allows you to see that it is working. The timer displays the database time, which may differ from the local time on the PC.

NOTE:

You should only write corrective constraints for use with the timer. You should also make sure that when such constraints are evaluated, they cannot lead to violations, or messages requiring user interaction.