I just noticed that BasicDataSource has a close method (and implements AutoCloseable). As a general principle, anything with a close method needs to be managed as part of a lifecycle which includes explicit close; we can’t just rely on gc.
This is a problem, because Schema is not part of a lifecycle. (That is by design, and is a good thing, mostly.) Julian > On May 28, 2019, at 8:24 AM, Andrei Sereda <[email protected]> wrote: > > Hello, > > Why DataSource is created inside the loop ? > > I think connection.close() releases connection to DBCP pool but does not > explicitly closes it. > > Regards, > Andrei. > > On Tue, May 28, 2019 at 8:24 AM Yuzhao Chen <[email protected]> wrote: > >> What do you mean by close the Schema ? >> >> Best, >> Danny Chan >> 在 2019年5月28日 +0800 AM11:41,[email protected],写道: >>> >>> Schema >>
