testcontainers-java icon indicating copy to clipboard operation
testcontainers-java copied to clipboard

chore: refactor JDBC tests to avoid leaking DataSource & friends

Open jerrinot opened this issue 3 years ago • 1 comments

performQuery() is leaking DataSources, Connections and Statements. Chances are it's also leaking ResutSets, unless a caller closes it. This is an attempt to fix it.

I kept the leaky method as there can be users outside the main repo.

I stumbled upon this while working on https://github.com/testcontainers/testcontainers-java/pull/5606

jerrinot avatar Jul 24 '22 11:07 jerrinot

btw- if you think this is overkill then feel free to close it. no hard feelings :)

jerrinot avatar Jul 25 '22 21:07 jerrinot