I have a datasource targeted to a cluster with two weblogic managed servers i.e 239.112.112.47:8001 and 239.112.112.48:9001
The datasource has deafult max capacity for the connection pool set to 15.
Thus, I am expection a total of 15*2=30 connections.
However, my client code gets only 15 connections that too on a single server(239.112.112.47:8001) and not on both servers of my cluster.
Below is my code:
public static void main(String ar[])throws Exception
{
InitialContext ic=null;
try{
Hashtable env = new Hashtable();
env.put(Context.INITIAL_CONTEXT_FACTORY, JNDI_FACTORY);
env.put(Context.PROVIDER_URL, 239.112.112.47:8001);
ic = new InitialContext(env);
}
catch(Exception e){
System.out.println("\n\n\t Unable To Get The InitialContext => "+e);
}
Connection con[]=new Connection[100];
try{
for(int i=0;i<100;i++)
{
DataSource ds=(DataSource)ic.lookup("MyDS"); //Enter your DataSource or MultidataSource JNDI name Here
con[i]=ds.getConnection();
System.out.println("\n\n\t GOT CONNECTION con["+i+"]: "+con[i]);
Thread.sleep(1000);
}