Red Hat Bugzilla – Bug 728272
make sure JDBC connections, statements, and resultsets get closed after we are done with them
Last modified: 2013-08-05 20:40:26 EDT
Coverity reports dozens of places in the RHQ Server code where we don't close connections, statements, and resultsets. Sometimes we don't close them when an exception occurs, and other times we don't close them even in the non-exception case.
In our perf environment, Oracle EM is warning that it has 5000 open cursors. There are probably so many because of the un-closed/abandoned connections, statements, and resultsets.
JBoss AS can be configured to auto-close abandoned connections, statements, and resultsets.
The RHQ Server AS is already configured to auto-close connections, but not to auto-close statements and resultsets. To do the latter, we need to add:
to both of the datasources defined in rhq-ds.xml.
Whenever JBoss auto-closes a connection, statement, and resultset, it logs a nasty warning, so, longer term, we should go through our code and make sure to close the connections, statements, and resultsets ourselves. Coverity will give us a list of all of the culprits.
I added <track-statements>true</track-statements> to each of the RHQ datasources in the perftest branch - commit cbef4d2. Once this has been tested in the perf env, we'll merge it into master.
Author: Robert Buck <firstname.lastname@example.org>
Date: 2011-09-26 08:54:05 -0400
oracle em cites lots of open cursor issues; fix open cursor leaks by closing result sets and prepared statements in finally blocks.
verified general functionality through successful automation run.
changing status of VERIFIED BZs for JON 2.4.2 and JON 3.0 to CLOSED/CURRENTRELEASE