Previous Topic: Run Units, Locks, and Database TransactionsNext Topic: Sharing Run Units Between Programs


Run Units

A run unit is a database session that begins with the BIND RUN-UNIT statement and (if successful) ends with the FINISH statement. A program can serially bind and finish any number of run units, but typically binds only one.

Note: If your program binds run units serially, you must reinitialize the ERROR-STATUS field in the IDMS communications block to the value 1400 before reissuing the BIND RUN-UNIT and READY statements.

An application consisting of multiple programs can bind concurrent run units, since each program can bind its own run unit.

When a run unit starts, it is associated with a database transaction representing the recoverable work done by the run unit. A database transaction can be shared by multiple database sessions -- both run units and SQL sessions. Sharing a transaction eliminates deadlocks between the sharing sessions, but impacts the commit operation and introduces the potential for interference between the sharing sessions.

For more information on how to share transactions and the considerations in doing so, see Sharing Transactions Among Sessions.