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:
  1. db2commexitRegister for a new socket connection.
  2. db2commexitRecv and db2commexitSend to handle authentication, possibly multiple times.
  3. db2commexitUserIdentity for a new connection
  4. db2commexitRecv and db2commexitSend to handle clients SQL requests, possibly multiple times.
  5. db2commexitRecv and db2commexitSend to 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.

  6. db2commexitUserIdentity for a trusted context switch user.
  7. db2commexitRecv and db2commexitSend to handle clients SQL requests, possibly multiple times.
  8. db2commexitDeregister to terminate socket connection.

Runtime communication exit library

The following calls are made:
  1. db2commexitSessionInit for a new connection.
  2. db2commexitSQL* to handle SQL requests.
  3. db2commexitSessionTerm to close a user session.
  4. db2commexitSessionInit for a new user session.
  5. db2commexitSQL* to handle SQL requests.
  6. db2commexitSessionTerm to close a connection.