mobileNavlogo
headerlogo

Blog

Detecting Connection Leaks in JBoss

24 September, 2020

Related Blogs

Detecting Connection Leaks in JBoss

Detecting Connection Leaks JBoss has a CachedConnectionManager service that can be used to detect connection leaks (within the scope of a request) Configured in ${jboss.server.url}/deploy/jbossjca-service.xml Triggered by Tomcat’s server.xml→<Host>→CachedConnectionValve

Enabled by default - slight overhead

Should be used during testing

Can be turned off in production if the code is stable

If the CachedConnectionValve is enabled in Tomcat’s server.xml file, then Tomcat must wait for the CachedConnectionManager service on startup. This is accomplished by adding the following line to Tomcat’s META-INF/jboss-service.xml file (near the end):

<depends>jboss.jca:service=CachedConnectionManager</depends>

Connection pools could be monitored (through JMX) by looking at jboss.jca:name=MyDS,service=ManagedConnectionPool→InUseConnectionCount attribute. The example web application northwind.war can be made to leak resources (on /ListCustomers) by

appending requesting /ListCustomers?leak=true, and/or by

adding a custom system property: -Dleak.jdbc.resources=true to JAVA_OPTS in run.conf or run.bat (on Windows)

For an in-depth understanding on JBoss click on:

About Author
Authorlogo
Name

TekSlate

Author Bio

TekSlate is the best online training provider in delivering world-class IT skills to individuals and corporates from all parts of the globe. We are proven experts in accumulating every need of an IT skills upgrade aspirant and have delivered excellent services. We aim to bring you all the essentials to learn and master new technologies in the market with our articles, blogs, and videos. Build your career success with us, enhancing most in-demand skills .