I think you need to put ServerSocker accept on another thread.Because EJB call defaults to synchronous which means the call will not reture until EJB finish its running !
JBoss 2.4.3 (WindowsNT & RedHat 6.2)
ServerSocket.accept() is running in a separate thread according to the usual implementation of multi-threaded server applications in Java.
A new thread is being created to process each socket returned from ServerSocket.accept(). The socket is then
read and closed before the call to the EJB method.
Have you tried replacing the EJB call with
this should make sure it is not your code. :-)
Yes, I've done precisely that and various other tests. When testing, I can accept and process multiple concurrent connections without any problems.
As soon as I call any EJB method from one of the spawned threads, however, ServerSocket.accept() refuses to accept any further connections for the duration of the method call.
I don't know what's wrong then.
Can you post your code? Or a small test program with
the same problem?
Alternatively, have a look at the Tomcat/Jetty contributions to JBoss. They are doing the same you
(except perhaps local EJB calls) without this problem.
Sorry I've taken so long to reply. I have discovered what the problem is and I have rectified it.
The problem was with my EJBs on the server. I have a session bean that generates unique IDs for entity beans and this was(every 200 invocations) obtaining a Connection from the pool and calling Connection.setTransaction(TRANSACTION_SERIALIZABLE). before obtaining a new starting ID. The failure to reset the transaction level before returning the Connection to the pool was resulting in a pool with, eventually, every Connection set to TRANSACTION_SERIALIZABLE.
My apparently limited knowledge of transations prevents me from understanding why this should affect code running in a different thread on the client.