Files
Sebastian Lohff 13c9c9a433 Use reader context for DB queries
In most cases FirewallPluginDb has opened reader/writer contexts for its
db access, but not in all.

Once instance in which this can fail is when the port AFTER_UPDATE
event handler is called. This method might call
get_fwg_attached_to_port() outside of a transaction, which currently
automatically opens one. This will explicitly fail when a transaction
guard is hit with an exception:

RuntimeError: Must not be called in a transaction

To avoid this, we add a reader context to get_fwg_attached_to_port() and
while we're at it we're adding this to all FirewallPluginDb methods that
do a model_query db query - just to be on the safe side.

Change-Id: Iabb9bc6877059bcc46d64b7fc2d0728e6002610b
Closes-Bug: #2114919
2025-06-18 18:37:22 +02:00
..
2022-03-01 01:01:47 +00:00
2022-03-01 01:01:47 +00:00