-
Type:
Task
-
Status: Open (View Workflow)
-
Priority:
Normal
-
Resolution: Unresolved
-
Component/s: spt_operational_database
-
Labels:None
This ticket is triggered by the tel_status tables not being updated.
The opdb.insert_kw() method uses the following code:
with self.engine.connect() as conn: conn.execute(insertStatement)
But that idiom is no longer supported (it went against the DBAPI PEP 249, but sqlalchemy left support in), and the transaction is rolled back when the context exits (so no new tel_status rows).
Instead, one of the two following idioms should be used (with the first being preferred, but the second being more explicit):
with engine.begin() as conn: conn.execute(insertStatement)
or
with engine.connect() as conn: with conn.begin(): conn.execute(insertStatement)
I have not checked the other calls in opdb.py.