If your application program is defined as threadsafe, it can receive control on an open transaction environment (OTE) TCB. This happens if a program in the task issues a DB2® SQL request that causes CICS® to pass control to the CICS DB2 adaptor on an L8 open TCB. Although the task is attached and runs initially on the CICS QR TCB, CICS switches it to an L8 TCB for the execution of the DB2 request. If you define the application program issuing the SQL request as threadsafe, CICS leaves the task running on the L8 open TCB on return from DB2, to avoid a costly TCB switch. For more information, see the CICS DB2 Guide.
To obtain the maximum performance benefit from OTE, write your CICS DB2 application programs in a threadsafe manner to avoid CICS having to switch TCBs. However, be aware that not all EXEC CICS commands are threadsafe, and issuing any of the non-threadsafe commands causes CICS to switch your task back to the QR TCB to ensure serialization. The commands that are threadsafe are indicated in the command syntax diagrams in this programming reference with the statement: "This command is threadsafe", and are listed in Threadsafe command list.
For information about writing threadsafe application programs, see the CICS Application Programming Guide.