[jboss-user] [EJB/JBoss] - slow remote EJB call inside loop, reconnect ?

roko98 do-not-reply at jboss.com
Wed Jul 16 00:55:39 EDT 2008


Hi all

I'm using JBOSS 4.2.2GA, JDK1.5.0_15 and EJB 3.0. I'm calling the remote interface from a client. I wanted to make a test run and made my calls within a while loop

Orchestrator orchestrator = (Orchestrator)context.lookup("OrchestratorBean/remote");
  | 		
  | long startTime = System.currentTimeMillis();
  | 		
  | for(int i = 0; i < 1000; i++) {
  | 	System.out.println(orchestrator.hello());
  | }
  | 
  | long endTime = System.currentTimeMillis();
  | 

I notice that every time I call the hello() method, the client connect / disconnect from the server:

anonymous wrote : DEBUG [main] (MicroSocketClientInvoker.java:243) - SocketClientInvoker[1684706, socket://localhost:3873] constructed
  | DEBUG [main] (MicroRemoteClientInvoker.java:240) - SocketClientInvoker[1684706, socket://localhost:3873] connecting
  | DEBUG [main] (MicroRemoteClientInvoker.java:245) - SocketClientInvoker[1684706, socket://localhost:3873] connected
  | DEBUG [main] (ClientSocketWrapper.java:169) - reset timeout: 0
  | DEBUG [main] (InvokerRegistry.java:595) - removed SocketClientInvoker[1684706, socket://localhost:3873] from registry
  | DEBUG [main] (MicroSocketClientInvoker.java:276) - SocketClientInvoker[1684706, socket://localhost:3873] disconnecting ...
  | DEBUG [main] (SocketWrapper.java:123) - ClientSocketWrapper[Socket[addr=/127.0.0.1,port=3873,localport=36584].15d4de6] closing

Why this happen ? I imagine that's the reason for the loop taking so long.. This connection can be pooled ? Thx.

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4164643#4164643

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4164643



More information about the jboss-user mailing list