close
Releases the resources this database holds so its backing files can be deleted or replaced. Idempotent. After close the database is unusable: metadata and query operations route through longLastingConnection, which is now closed.
Closes the single long-lived JDBC connection (longLastingConnection) if it was ever opened. A held connection is what locks the SQLite
.dbfile on Windows; closing it releases the file.For an embedded Derby database, additionally issues the engine shutdown, because Derby keeps the database booted — holding
db.lck— after every connection is closed, until an explicit;shutdown=true.If dataSource is a pool (a HikariCP
HikariDataSource, used by the properties/Postgres path), closes it too. The plain embedded SQLite/Derby data sources are notAutoCloseable, so this is a no-op for them.