Commit b2bbe420 authored by Hanno Schlichting's avatar Hanno Schlichting

During startup open a connection to every configured database, to ensure all...

During startup open a connection to every configured database, to ensure all of them can indeed be accessed. This avoids surprises during runtime when traversal to some database mountpoint could fail as the underlying storage cannot be opened at all.
parent 08145c1f
...@@ -16,6 +16,11 @@ Bugs Fixed ...@@ -16,6 +16,11 @@ Bugs Fixed
Features Added Features Added
++++++++++++++ ++++++++++++++
- During startup open a connection to every configured database, to ensure all
of them can indeed be accessed. This avoids surprises during runtime when
traversal to some database mountpoint could fail as the underlying storage
cannot be opened at all.
- Explicitly close all databases on shutdown, which ensures `Data.fs.index` - Explicitly close all databases on shutdown, which ensures `Data.fs.index`
gets written to the file system. gets written to the file system.
......
...@@ -93,6 +93,17 @@ def startup(): ...@@ -93,6 +93,17 @@ def startup():
else: else:
DB = ZODB.DB(m.Storage, databases=databases) DB = ZODB.DB(m.Storage, databases=databases)
# Force a connection to every configured database, to ensure all of them
# can indeed be opened. This avoids surprises during runtime when traversal
# to some database mountpoint fails as the underlying storage cannot be
# opened at all
for mount, name in dbtab.listMountPaths():
_db = dbtab.getDatabase(mount)
_conn = _db.open()
_conn.close()
del _conn
del _db
notify(DatabaseOpened(DB)) notify(DatabaseOpened(DB))
Globals.BobobaseName = DB.getName() Globals.BobobaseName = DB.getName()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment