diff --git a/lib/galaxy/model/__init__.py b/lib/galaxy/model/__init__.py index 53bd1e5faedb..58ec74da3dd8 100644 --- a/lib/galaxy/model/__init__.py +++ b/lib/galaxy/model/__init__.py @@ -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: