Connection Pool statistics look low and database shows more than expected connections

Solution Verified - Updated

Environment

  • Red Hat JBoss Enterprise Application Platform prior to 6.4.5
  • prefill=true as defined in
    • jboss-as-datasources_1_1.xsd
    • jboss-as-datasources_1_2.xsd

Issue

  • JDBC connection leak
  • apps are closing connections properly still lot of inactive session at DB side
  • causing slow performance and eventually bringing down the application and DB
  • Datasource statistics ActiveCount is dramatically different from the open connections as reported by the database server
  • The datasource pool has prefill enabled

Resolution

Root Cause

This is a known defect (Content from issues.jboss.org is not included.JBJCA-1276).

Diagnostic Steps

grep'ing a TRACE log for multiple occurrences of managed connection pool instances can be done to determine if JBJCA-1276 is affecting an evironment. [1] shows an environment that needs prefill = false or EAP 6.4.5 applied. [2] shows a healthy environment.

[1]

$ grep -o SemaphoreArrayListManagedConnectionPool.*<pool name> server.log | sort -u
SemaphoreArrayListManagedConnectionPool@41093a00[pool=<pool name>
<multiple entries>
...

[2]

$ grep -o SemaphoreArrayListManagedConnectionPool.*<pool name> server.log | sort -u
SemaphoreArrayListManagedConnectionPool@41093a00[pool=<pool name>
<no more hits returned>
Tags

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.