diff --git a/arborist/read.py b/arborist/read.py index b10f9fa..df44e90 100644 --- a/arborist/read.py +++ b/arborist/read.py @@ -1105,6 +1105,16 @@ class SessionsView: "file:{0}?mode=ro".format(path), uri=True, check_same_thread=False, ) + # Autocommit: every SELECT runs in its own implicit + # transaction that ends as soon as the cursor is consumed. + # Without this, Python's sqlite3 default ("legacy" mode) + # opens an implicit read transaction on the first SELECT + # and holds it until commit/rollback — pinning the + # connection to a stale WAL snapshot when another process + # (the REPL writer) is committing live. The viz needs to + # see fresh writes from the user's REPL session without a + # restart. + self._conn.isolation_level = None self._conn.row_factory = sqlite3.Row except Exception as exc: log.warning("arborist.read.sessions: open failed for %s: %s",