Subject: JNDI Failover behavior -- with pooling mechanism on
Author: JNDI
In response to: JNDI Failover behavior
Posted on: 11/02/2011 05:30:32 PM
env.put(Context.PROVIDER_URL, "ldap://server1:389/ ldap://server2:389/");
env.put("com.sun.jndi.ldap.connect.pool", "true");
Testing scenarios:
Stage #1:   primary server(1) is up    +  sencondary server(2) is up
Stage #2:   primary server(1) is down  +  sencondary server(2) is up
Stage #3:   primary server(1) is up    +  sencondary server(2) is up
Test results are the same as without pooling:
Stage #1:   client connection goes to the primary server(1)
Stage #2:   client connection goes to the secondary server(2)
Stage #3:   client connection goes back to the primary server(1) again.
 
> 
> On 11/02/2011 05:27:40 PM 
JNDI wrote:
If you set the java.naming.provider.url to a list of LDAP servers:
env.put(Context.PROVIDER_URL, "ldap://server1:389/ ldap://server2:389/");
then each connection is attempted in turn until a single connection is successfully established.
The question is: What happens if the dropped connection come back:
Testing scenarios:
Stage #1:   primary server(1) is up    +  sencondary server(2) is up
Stage #2:   primary server(1) is down  +  sencondary server(2) is up
Stage #3:   primary server(1) is up    +  sencondary server(2) is up
Test results:
Stage #1:   client connection goes to the primary server(1)
Stage #2:   client connection goes to the secondary server(2)
Stage #3:   client connection goes back to the primary server(1) again.
References: