db restore rollback fix
All checks were successful
Deploy Plattform-Core / test (push) Successful in 54s
Deploy Plattform-Core / deploy (push) Successful in 5s

This commit is contained in:
ValueOn AG 2026-05-25 08:12:37 +02:00
parent a46e12638e
commit 31955751fb

View file

@ -486,12 +486,14 @@ def _insertRows(
try: try:
with conn.cursor() as cur: with conn.cursor() as cur:
cur.execute("SAVEPOINT row_sp")
cur.execute(sql, values) cur.execute(sql, values)
inserted += cur.rowcount inserted += cur.rowcount
cur.execute("RELEASE SAVEPOINT row_sp")
except Exception as e: except Exception as e:
logger.warning("Insert failed for %s row: %s", tableName, e) logger.warning("Insert failed for %s row: %s", tableName, e)
conn.rollback() with conn.cursor() as cur:
conn.autocommit = False cur.execute("ROLLBACK TO SAVEPOINT row_sp")
return inserted return inserted