Re: [PR] VELOCITY-989 Fixed multiple connection leaks in Dat aSourceResourceLoader. [velocity-engine]

FrancisS (via GitHub) <[email protected]>
Newsgroups gmane.comp.jakarta.velocity.devel
Message-ID <PR_kwDOAN72MM6Ubueq-aeed8ffc-114e-46f0-b4e7-70c8c33ed7d0@gitbox.apache.org>
FrancisS commented on PR #57:
URL: https://github.com/apache/velocity-engine/pull/57#issuecomment-2875043962

   XPosting from the jira issue:
   I updated the PR with a fix that I don't love but I can't find a way to do it differently without changing the API of DatabaseObjectsFactory. I updated the factory to return a proxy of Statement and ResultSet that guarantees Statement.getConnection and ResultSet.getStatement behave in a way that will not cause issues.
   
   However I would prefer to change DatabaseObjectsFactory.prepareStatement and DatabaseObjectsFactory.releaseStatement to use an explicit wrapper object instead. This would avoid the somewhat hard to follow proxy code and would be a bit more obvious to anyone writing custom implementations of DatabaseObjectsFactory that the original connection and statement are needed rather then relying on Statement.getConnection or ResultSet.getStatement.
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.