API calling sequence - Connect without a connect reset

This scenario covers a connect over an existing socket. The client might initiate another SQL connection without first issuing a connect reset. 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

When the database manager receives the SQL connect statement from the client, it implicitly drives an internal connect reset before it continues with the connect. Regular requests and replies flow back and forth as there is no change to the status of the socket. In this case, a single agent is handling all requests. As the buffers that contain the connect request from the client is made available through db2commexitRecv, the communication buffer exit library is able to determine a new connect is started when the buffer is parsed. 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 client SQL requests, possibly multiple times.
  5. db2commexitRecv and db2commexitSend to handle authentication, possibly multiple times.
  6. db2commexitUserIdentity for a new connection.
  7. db2commexitRecv and db2commexitSend to handle client SQL requests, possibly multiple times.
  8. db2commexitDeregister to terminate socket connection.
Note: db2commexitRegister and db2commexitDeregister are called only a single time each, even though the database manager processed two SQL connections.

Runtime communication exit library

When the database manager receives the SQL connect statement from the client, it implicitly drives an internal connect reset before it continues with the connect. In this case, a single agent is handling all requests. The following calls are made:
  1. db2commexitSessionInit for a new connection.
  2. db2commexitSQL* to handle SQL requests.
  3. db2commexitSessionTerm to close a connection.
  4. db2commexitSessionInit for a new connection.
  5. db2commexitSQL* to handle SQL requests.
  6. db2commexitSessionTerm to close a connection.