1 of 1 people found this helpful
The underlying protocol might close the connection later or reuse it, depend on the implementation.
So it might that the connection gets closed after a full GC.
It´s very strange. Even performing GC via Java VisualVM application like the following link explains http://visualvm.java.net/monitor_tab.html the connection doesn´t get being closed. When I run JUnit test in Eclipse IDE, using config file 'jboss-ejb-client.properties', I see the connection being established and then closed after method execution. But an application (.war) deployed in JBoss 7.1.1 using config file 'jboss-ejb-client.xml' with appropriate configuration doesn´t close the connection after method execution, even when app is removed or disabled from server.
If you use a server-side configuration the server might decide to keep the physical connection open if you undeploy the application and close it later if the resource is not used fo a longer time.
There are some enhancements and fixes around ejb and remoting, so I recommend to try a newer version (like WildFly) to check whether the problem is solved. AS7.1.1 is quite old.