Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix cleanup of database resources. #58

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

salsolatragus
Copy link

In several places in your codebase, PreparedStatements or ResultsSets are not closed (generally or in case of errors while executing queries). This pull request fixes several such usages, as identified by our automated detector MUDetect. We would very much appreciate your feedback on our patch. Thank you very much!

The ResultSet postResult is left open. This might lead to a resource leak with some JDBC drivers or to a “maximum open sursors exceeded” exception, in case too many result sets are left unclosed. See https://stackoverflow.com/questions/4507440/must-jdbc-resultsets-and-statements-be-closed-separately-although-the-connection
The ResultSet privResult is left open, if an exception occurs while fetching results in lines 351/352. This might lead to a resource leak with some JDBC drivers or to a “maximum open sursors exceeded” exception, in case too many result sets are left unclosed. See https://stackoverflow.com/questions/4507440/must-jdbc-resultsets-and-statements-be-closed-separately-although-the-connection
The PreparedStatement addAdminPstmt is left open. This might lead to a resource leak with some JDBC drivers. See https://stackoverflow.com/questions/4507440/must-jdbc-resultsets-and-statements-be-closed-separately-although-the-connection
The PreparedStatement addAdminPstmt is left open. This might lead to a resource leak, since the connection is managed outside the method and might be left open for a long time, such that many open statements accumulate. See https://stackoverflow.com/questions/4507440/must-jdbc-resultsets-and-statements-be-closed-separately-although-the-connection
The PreparedStatement addAdminPstmt is left open. This might lead to a resource leak, since the connection is managed outside the method and might be left open for a long time, such that many open statements accumulate. See https://stackoverflow.com/questions/4507440/must-jdbc-resultsets-and-statements-be-closed-separately-although-the-connection
The PreparedStatements originalPost and replies and the ResultSets postResult and repliesResult are left open. This might lead to a resource leak, since the connection is managed outside the method and might be left open for a long time, such that many open statements/result sets accumulate. See https://stackoverflow.com/questions/4507440/must-jdbc-resultsets-and-statements-be-closed-separately-although-the-connection
The ResultSet privResult is left open, if an exception occurs while fetching results in lines 291 or 305. This might lead to a resource leak with some JDBC drivers or to a “maximum open sursors exceeded” exception, in case too many result sets are left unclosed. See https://stackoverflow.com/questions/4507440/must-jdbc-resultsets-and-statements-be-closed-separately-although-the-connection
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant