Skip to content

Ensure every JDBC database use case that returns a stream is closed #10129

Closed
@tuliren

Description

@tuliren

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.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions