API calling sequence - SET SESSION AUTHORIZATION statement

This scenario covers the API calling sequence when the SET SESSION AUTHORIZATION statement is used. 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 SET SESSION AUTHORIZATION statement changes the session authorization ID in use for the current connection. Db2commexitUserIdentity is called to inform the communication buffer exit library that identity information changed for the current connection. 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.

    The user issues a SET SESSION AUTHORIZATION statement. This request is passed to db2commexitRecv. It is no different from other SQL statement.

  5. db2commexitUserIdentity for a SET SESSION AUTHORIZATION.
  6. db2commexitRecv and db2commexitSend to handle client SQL requests, possibly multiple times.
  7. db2commexitDeregister to terminate socket connection.

Runtime communication exit library

The SET SESSION AUTHORIZATION statement changes the session authorization ID in use for the current connection. Db2commexitSetSessionAuth is called to inform the communication buffer exit library that identity information changed for the current connection. The following calls are made:
  1. db2commexitSessionInit for a new connection.
  2. db2commexitSQL* to handle new SQL requests.

    The user issues a SET SESSION AUTHORIZATION statement. This request is no different from other SQL statement

  3. db2commexitSetSessionAuth for a SET SESSION AUTHORIZATION.
  4. db2commexitSQL* to handle new SQL requests.
  5. db2commexitSessionTerm to close the connection.