Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions base_external_dbsource_mssql/models/base_external_dbsource.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,8 @@ def _execute_mssql(self, sqlquery, sqlparams, metadata):
# If the query doesn't return rows, trying to get them anyway
# will raise an exception `sqlalchemy.exc.ResourceClosedError`
rows = [r for r in cur] if cur.returns_rows else []
# cur.returns_rows is False for DML (INSERT/UPDATE/DELETE),
# which need an explicit commit to persist changes.
if not cur.returns_rows:
connection.commit()
return rows, cols
Loading