If the application is local, the thread is created when the first SQL statement is executed. After the thread is created, SQL statements can be executed. From this table, DB2 obtains the load module associated with and other information related to the stored procedure. When DB2 notifies the stored procedure address space to execute a stored procedure, the thread that was created for the client application is reused for an execution.
Accounting is on behalf of the client application.
No sign-on or connection processing is required. Any processing done by the stored procedure is considered a logical continuation of the client application's unit of work. Thus, locks acquired by the stored procedure are released when the client application commits or rolls back. Control is passed to the stored procedure along with the input and output parameters. The stored procedure can issue most SQL statements.