Discovering Locators Dynamically

Discovering Locators Dynamically

A background thread periodically queries the locator for any other locators joining
the distributed system. To balance load across all the locators, locators are shuffled
before pushing in the list.

However, If locator A (to which the client is connected) goes down before it discovers
locator B, the locator B is never discovered even though it is alive and the client
receives a NoLocatorsAvailable exception.

One connection is attached to every application thread that is local to
the respective thread. This is known as a thread local connection.

In this case, to perform any cache operation the client is not required to obtain a
connection from pool. Instead the thread local connection of the client is used.

A thread local connection can be released by invoking the
Pool::releaseThreadLocalConnection() method. The released
connection is returned to the pool. If the number of threads is larger than the number
of max-connections, the client throws an
AllConnectionsInUseException after the
free-connection-timeout lapses, unless the
Pool::releaseThreadLocalConnection() method is used judiciously.

If a connection expires or the server goes down on which the connection was established,
a thread local connection is immediately replaced with a good connection obtained from
the pool.