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
IDEMPIERE-5994 Connection leak when using DB.prepareStatement(badSql, null) #2184
IDEMPIERE-5994 Connection leak when using DB.prepareStatement(badSql, null) #2184
Conversation
m_conn.close(); | ||
m_conn = null; | ||
} catch (SQLException e1) {} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
doesn't need the localConn stuff, just need to call this.close() here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @hengsin
this.close() is not available at this point
the "localconn" is to avoid closing a connection that is managed elsewhere, I just need to close here the connections created locally in the same method.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, you need to change StatementProxy.close to protected. Calling the close method of StatementProxy should be the correct approach here, not the method above.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @hengsin - tested your suggestion and it worked fine.
a746edc
to
8e673df
Compare
m_conn.close(); | ||
m_conn = null; | ||
} catch (SQLException e1) {} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, you need to change StatementProxy.close to protected. Calling the close method of StatementProxy should be the correct approach here, not the method above.
8e673df
to
d20a6d0
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good
… null) (#2184) * IDEMPIERE-5994 Connection leak when using DB.prepareStatement(badSql, null) * - implement approach suggested by Heng Sin
… null) (#2184) * IDEMPIERE-5994 Connection leak when using DB.prepareStatement(badSql, null) * - implement approach suggested by Heng Sin
https://idempiere.atlassian.net/browse/IDEMPIERE-5994
Pull Request Checklist
Tests