def _lock_workflow_execution(wf_exec_id): # NOTE: Workflow execution object must be locked before # loading the object itself into the session (either with # 'get_XXX' or 'load_XXX' methods). Otherwise, there can be # multiple parallel transactions that see the same state # and hence the rest of the method logic would not be atomic. db_api.acquire_lock(db_models.WorkflowExecution, wf_exec_id)
def _lock_workflow_execution(wf_exec_id): # NOTE: Workflow execution object must be locked before # loading the object itself into the session (either with # 'get_XXX' or 'load_XXX' methods). Otherwise, there can be # multiple parallel transactions that see the same state # and hence the rest of the method logic would not be atomic. db_api.acquire_lock(db_models.WorkflowExecution, wf_exec_id)
def lock_workflow_execution(wf_ex_id): # Locks a workflow execution using the db_api.acquire_lock function. # The method expires all session objects and returns the up-to-date # workflow execution from the DB. return db_api.acquire_lock(db_models.WorkflowExecution, wf_ex_id)
def lock(self): assert self.wf_ex return db_api.acquire_lock(db_models.WorkflowExecution, self.wf_ex.id)
def lock(self): assert self.wf_ex return db_api.acquire_lock(db_models.WorkflowExecution, self.wf_ex.id)