diff --git a/lib/galaxy/model/__init__.py b/lib/galaxy/model/__init__.py index a8747f62bddd..795e1dbddb67 100644 --- a/lib/galaxy/model/__init__.py +++ b/lib/galaxy/model/__init__.py @@ -1697,9 +1697,10 @@ 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: