Problem:
Product Name: VisiBroker for JavaWhy is "idle" connection not recycled for use when maximum number of connections is reached?
In the VisiBroker for Java Developer's guide, under the Chapter "Managing threads and connections" Section "Connection management", the last statement of the section stated that Inactive connections will be recycled when the maximum number of connections is reached. To illustrate, assume you set the maximum number of connections to 10 (connectionMax=10) and the connectionMaxIdle to 300 (5 minutes).
In the first minute, ten different clients connect to the server, execute a CORBA call and go into idle state. In the second minute, the eleventh client tries to connect to the server. What happens next?
Will the eleventh client be able to connect to the server?
The expected answer is yes.
However, if you have set connectionMaxIdle to a non-zero value, and the idle time of the first ten connections have not exceeded this connectionMaxIdle value, then no connection will be closed and consequently, new connection could not be established and the eleventh client fails to connect to the server.
This problem will not arise if connectionMaxIdle has not been specified(i.e., when maximum number of connections is reached, the Least Recently Usedconnection will be closed if a new connection is needed).
Resolution:
This unexpected behaviour has been rectified in VisiBroker 6.5 in hotfix 06.05.00.P14.13.
When this hotfix for VisiBroker 6.5 Service Pack 14 is applied and the eleventh client tries to connect to the server, the VisiBroker orb will first close the connection that has been idling for the longest period of time (i.e., least-recently-used) before creating a new connection for the eleventh client.
#Security
#VisiBroker
#connection
#connectionMax
#connectionMaxIdle
#idle