Connection Pool statistics look low and database shows more than expected connections
Environment
- Red Hat JBoss Enterprise Application Platform prior to 6.4.5
prefill=trueas defined injboss-as-datasources_1_1.xsdjboss-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
ActiveCountis dramatically different from the open connections as reported by the database server - The datasource pool has
prefillenabled
Resolution
- This issue1 is resolved in This content is not included.EAP 6.4 cumulative patch (CP) 5 and later releases. Production systems should use the latest available cumulative patch.
- For older releases (not using current patch levels), set
prefill=falseon the affected datasource .
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>
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.