mirror of
https://github.com/searxng/searxng.git
synced 2025-12-21 12:27:24 -05:00
A Connection object can be used as a context manager that automatically commits or rolls back open transactions when leaving the body of the context manager. If the connection attribute ``isolation_level`` is **not** ``None``, new transactions are implicitly opened before ``execute()`` and ``executemany()`` executes SQL- INSERT, UPDATE, DELETE, or REPLACE statements [1]. The old implementation set ``isolation_level`` to ``None`` and thereby prevented the context manager from opening and closing the transaction scopes. [1] https://docs.python.org/3/library/sqlite3.html#sqlite3-transaction-control-isolation-level [2] https://github.com/searxng/searxng/pull/5239#discussion_r2381416731 Reported-by: Ivan G <igabaldon@inetol.net> [2] Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>