Added support for Closeable in MySqlConnectionFactory #110
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi @jchrys,
#66
I added support for the Closeable interface in MySqlConnectionFactory and I also removed the invocation of the deprecated getSocketTimeout() and replaced it with null in MySqlConnectionFactory. Let me know if there are any problems in the code.
Motivation: MySqlConnectionFactory could benefit from a way to release its resources through implementing the Closeable interface.
Modification: MySqlConnectionFactory now implements Closeable and contains the close() method that will close the underlying MySqlConnection resource. I also added a logger to add the close start/end progress to the log. I removed the configuration.getSocketTimeout() parameter from Client.connect in the from() method and replaced it with null.
Result: MySqlConnectionFactory now has a way for users to release its resources.