Skip to content

Commit

Permalink
Merge pull request #17932 from mvdbeek/fix_InvalidRequestError
Browse files Browse the repository at this point in the history
[24.0] Fix ``InvalidRequestError: Can't operate on closed transaction inside context manager.  Please complete the context manager before emitting further commands.``
  • Loading branch information
jdavcs authored Apr 8, 2024
2 parents 7278fa5 + b147669 commit 89ac780
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/galaxy/model/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1697,9 +1697,9 @@ def set_state(self, state: JobState) -> bool:
.where(Job.id == self.id, ~Job.state.in_((state, *Job.finished_states)))
.values(state=state)
)
with transaction(session):
session.commit()
if rval.rowcount == 1:
# Need to expire state since we just updated it, but ORM doesn't know about it.
session.expire(self, ["state"])
self.state_history.append(JobStateHistory(self))
return True
else:
Expand Down

0 comments on commit 89ac780

Please sign in to comment.