Summary of RRSAF behavior

The effect of any Resource Recovery Services attachment facility (RRSAF) function depends in part on what functions the program has already run. You should plan the RRSAF function calls that your program makes to avoid any errors and major structural problems in your application.

The following tables summarize RRSAF behavior after various inputs from application programs. The contents of each table cell indicate the result of calling the function in the first column for that row followed by the function in the current column heading. For example, if you issue TERMINATE THREAD and then IDENTIFY, RRSAF returns reason code X'00C12201'. Use these tables to understand the order in which your application must issue RRSAF calls, SQL statements, and IFI requests.

The RRSAF FIND_DB2_SYSTEMS function is omitted from these tables, because it does not affect the operation of any of the other functions

The following table summarizes RRSAF behavior when the next call is to the IDENTIFY function, the SWITCH TO function, the SIGNON function, or the CREATE THREAD function.

Table 1. Effect of call order when next call is IDENTIFY, SWITCH TO, SIGNON, or CREATE THREAD
Previous function Next function
IDENTIFY SWITCH TO SIGNON, AUTH SIGNON, or CONTEXT SIGNON CREATE THREAD
Empty: first call IDENTIFY X'00C12205'1 X'00C12204'1 X'00C12204'1
IDENTIFY X'00F30049'1 Switch to ssnm Signon 2 X'00C12217'1
SWITCH TO IDENTIFY Switch to ssnm Signon 2 CREATE THREAD
SIGNON, AUTH SIGNON, or CONTEXT SIGNON X'00F30049'1 Switch to ssnm Signon 2 CREATE THREAD
CREATE THREAD X'00F30049'1 Switch to ssnm Signon 2 X'00C12202'1
TERMINATE THREAD X'00C12201'1 Switch to ssnm Signon 2 CREATE THREAD
IFI X'00F30049'1 Switch to ssnm Signon 2 X'00C12202'1
SQL X'00F30049'1 Switch to ssnm X'00F30092'13 X'00C12202'1
SRRCMIT or SRRBACK X'00F30049'1 Switch to ssnm Signon 2 X'00C12202'1
Notes:
  1. Errors are identified by the Db2 reason code that RRSAF returns.
  2. Signon means either the SIGNON function, the AUTH SIGNON function, or the CONTEXT SIGNON function.
  3. The SIGNON, AUTH SIGNON, or CONTEXT SIGNON functions are not allowed if any SQL operations are requested after the CREATE THREAD function or after the last SRRCMIT or SRRBACK request.

The following table summarizes RRSAF behavior when the next call is an SQL statement or an IFI call or to the TERMINATE THREAD function, the TERMINATE IDENTIFY function, or the TRANSLATE function.

Table 2. Effect of call order when next call is SQL or IFI, TERMINATE THREAD, TERMINATE IDENTIFY, or TRANSLATE
Previous function Next function
SQL or IFI TERMINATE THREAD TERMINATE IDENTIFY TRANSLATE
Empty: first call SQL or IFI call4 X'00C12204'1 X'00C12204'1 X'00C12204'1
IDENTIFY SQL or IFI call4 X'00C12203'1 TERMINATE IDENTIFY TRANSLATE
SWITCH TO SQL or IFI call4 TERMINATE THREAD TERMINATE IDENTIFY TRANSLATE
SIGNON, AUTH SIGNON, or CONTEXT SIGNON SQL or IFI call4 TERMINATE THREAD TERMINATE IDENTIFY TRANSLATE
CREATE THREAD SQL or IFI call4 TERMINATE THREAD TERMINATE IDENTIFY TRANSLATE
TERMINATE THREAD SQL or IFI call 4 X'00C12203'1 TERMINATE IDENTIFY TRANSLATE
IFI SQL or IFI call4 TERMINATE THREAD TERMINATE IDENTIFY TRANSLATE
SQL SQL or IFI call4 X'00F30093'12 X'00F30093'13 TRANSLATE
SRRCMIT or SRRBACK SQL or IFI call4 TERMINATE THREAD TERMINATE IDENTIFY TRANSLATE
Notes:
  1. Errors are identified by the Db2 reason code that RRSAF returns.
  2. TERMINATE THREAD is not allowed if any SQL operations are requested after the CREATE THREAD function or after the last SRRCMIT or SRRBACK request.
  3. TERMINATE IDENTIFY is not allowed if any SQL operations are requested after the CREATE THREAD function or after the last SRRCMIT or SRRBACK request.
  4. If you are using an implicit connection to RRSAF and issue SQL or IFI calls, RRSAF issues implicit IDENTIFY and CREATE THREAD requests. If you continue with explicit RRSAF statements, you must follow the standard order of explicit RRSAF calls. Implicitly connecting to RRSAF does not cause an implicit SIGNON request. Therefore, you might need to issue an explicit SIGNON request to satisfy the standard order requirement. For example, an SQL statement followed by an explicit TERMINATE THREAD request results in an error. You must issue an explicit SIGNON request before issuing the TERMINATE THREAD request.