You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is a backport of the PR #238 to `v1.3-ossivalis` stable branch.
Currently when the last connection to a DB instance is closed, this DB
instance is destroyed.
This is not a big problem with file DBs, where subsequent connection
from the same process can just re-open the file (though some state,
like attached DBs is lost), but this is a problem with tagged in-memory
DBs (`jdbc:duckdb:memory:tag1` URLs), where all DB state is lost when
the DB is closed.
This does not apply to untagged `:memory:` DBs, which are private to a
single connection.
This change adds new connection property `jdbc_pin_db` (boolean,
`false` by default), when it is enabled, then the DB is pinned and is
kept alive in-memory even after the last connection to it is closed.
`DuckDBDriver.releaseDB(url)` method is added to allow client code to
release such DBs.
DBs that are left pinned are released automatically on JVM shutdown.
Testing: new test added.
0 commit comments