API calling sequence - Trusted context and switch user
This scenario is similar to connecting without a connect reset. The difference is the client requests a trusted context switch user rather than sending a new SQL connect request. Two API calling sequences are illustrated. One shows how to implement the sequence for a runtime communication exit library. The other shows how to implement the sequence for a communication buffer exit library.
Communication buffer exit library
The following
calls are made:
db2commexitRegisterfor a new socket connection.db2commexitRecvanddb2commexitSendto handle authentication, possibly multiple times.db2commexitUserIdentityfor a new connectiondb2commexitRecvanddb2commexitSendto handle clients SQL requests, possibly multiple times.db2commexitRecvanddb2commexitSendto handle authentication, possibly multiple times.At some future point, the client sends a trusted context switch user request to the server to switch the user for the connection.
db2commexitUserIdentityfor a trusted context switch user.db2commexitRecvanddb2commexitSendto handle clients SQL requests, possibly multiple times.db2commexitDeregisterto terminate socket connection.
Runtime communication exit library
The following
calls are made:
db2commexitSessionInitfor a new connection.db2commexitSQL*to handle SQL requests.db2commexitSessionTermto close a user session.db2commexitSessionInitfor a new user session.db2commexitSQL*to handle SQL requests.db2commexitSessionTermto close a connection.