DSNRLI is typically used as part of a SQL process to connect, open, execute SQL calls, commit or rollback changes, close and disconnect.
Any specified function parameters are read and stored. However, the only parameter used is the subsystem name, which equates to an XA Resource label. Refer to your IBM documentation for details of parameters and examples for each function: https://www.ibm.com/support/knowledgecenter/en/SSEPEK_12.0.0/apsg/src/tpc/db2z_rrsafconnectionfunctions.html.
The following table describes the DSNRLI functions that can be used to interface with RRSAF:
Function | Description |
---|---|
IDENTIFY | Initializes an XA resource's connection. |
SIGNON | Establishes a primary authorization ID and can also establish one or more secondary authorization IDs for a connection. |
CREATE THREAD | Allocates the XA resources that are required for an application to issue SQL or IFI requests. This function must complete before the application can execute SQL statements or IFI requests. |
SWITCH TO | Directs RRSAF, SQL, or IFI requests to a specified XA resource's subsystem. Use the SWITCH TO function to establish connections
to multiple XA resource subsystems from a single task.
DSNRLI also provides functions for switching between different subsystems using the SWITCH TO function. On the mainframe, this function directs subsequent SQL calls to the subsystem specified using the ssnm parameter. Use this SWITCH TO followed by IDENTIFY, SIGNON and CREATE THREAD to associate and open another XA Resource. This prevents subsequent SQL from being directed to that resource. The direction is provided by existing SQL functionality. SWITCH TO tells DSNRLI which resource the next calls apply to. |
TERMINATE THREAD | Deallocates XA resources that are associated with a plan and were previously allocated for an application using CREATE THREAD. You can then use CREATE THREAD to allocate another plan with the same connection. |
TERMINATE IDENTIFY | Terminates an XA resource's connection. Calling the TERMINATE IDENTIFY function is optional. If you do not call it, DSNRLI performs the same functions when the task terminates. |
SRRCMIT (CPIC) | Make all changes permanent (or committed) for the current logical unit of work. When a commit operation completes successfully, the changes to all protected resources associated with that logical unit of work are made permanent, and the updates are made available to other users of the protected resources. |
SRRBACK (CPIC) | Used to return the protected resources in a logical unit of work to their respective states at the previous sync point. When you request the backout operation, all changes made to protected resources since the last synchronization point are discarded. |