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:db2commexitRegister
for a new socket connection.db2commexitRecv
anddb2commexitSend
to handle authentication, possibly multiple times.db2commexitUserIdentity
for a new connection.db2commexitRecv
anddb2commexitSend
to handle client SQL requests, possibly multiple times.db2commexitRecv
anddb2commexitSend
to handle authentication, possibly multiple times.db2commexitUserIdentity
for a new connection.db2commexitRecv
anddb2commexitSend
to handle client SQL requests, possibly multiple times.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:
db2commexitSessionInit
for a new connection.db2commexitSQL*
to handle SQL requests.db2commexitSessionTerm
to close a connection.db2commexitSessionInit
for a new connection.db2commexitSQL*
to handle SQL requests.db2commexitSessionTerm
to close a connection.