By default, all connections on a stateless AppServer are unbound—that is, all AppServer agents are available to handle requests from any client connection. As long as an AppServer agent is not currently handling a client request, it can handle requests from any connected client. However, at any time during the handling of a client request, a client connection can become bound—that is, the AppServer agent handling the request becomes available to handle requests only from the client it is currently servicing. While a connection is bound, all requests from the connected client are handled by the same AppServer agent. In the same way it became bound, at any time during the handling of a client request, a bound connection can become unbound, at which point requests from the connected client can be handled by any available AppServer agent.
In general, then, a stateless AppServer agent is available to handle a client request as long as it is not currently processing a client request and as long as it is not waiting on a bound connection. If a stateless AppServer has no AppServer agents available to handle requests, all requests are queued at the AppServer broker until an AppServer agent becomes available.
To help an AppServer session perform common connection tasks, such as user authentication, you can configure a Connect procedure that runs for each connection request and a Disconnect procedure that runs for each disconnection request. For more information on these procedures, see Programming the AppServer.
A connection in the unbound state can transition to the bound state in two ways:
A client application invokes RUN PERSISTENT to instantiate a remote persistent procedure in the context of the connection. The AppServer agent that handles the remote persistent procedure request thus becomes bound to the connection.
The AppServer agent runs a procedure that sets the SERVER-CONNECTION-BOUND-REQUEST attribute on the SESSION handle to TRUE. The AppServer agent that sets this attributes thus becomes bound in the connection.
Note that it is the successful instantiation (by means of RUN PERSISTENT) of a remote persistent procedure that forces the connection to transition from the unbound state to the bound state. If a client fails in its attempt to instantiate a remote persistent procedure on an unbound connection, the connection remains unbound.