Closed
Description
Problem
Some of the JdbcDatabase
methods return a stream embedded with a database connection. The connection can only be closed when the consumption of the stream is done (in an onClose
callback), and the closure is not automatic. There are use cases that do not manually close those streams. This is not an intuitive operation because most Java streams do not require closure, as they are not involved with resources.
Solution
- [Minimum Requirement] Check every such use case and make sure the stream is closed or put in a
try
block. - [Nice to Have] Refactor the
JdbcDatabase
methods to remove those that return streams as much as possible.