コード例 #1
0
ファイル: default_engine.py プロジェクト: ainkov/mistral
 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)
コード例 #2
0
 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)
コード例 #3
0
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)
コード例 #4
0
    def lock(self):
        assert self.wf_ex

        return db_api.acquire_lock(db_models.WorkflowExecution, self.wf_ex.id)
コード例 #5
0
ファイル: workflows.py プロジェクト: anilyadav/mistral
    def lock(self):
        assert self.wf_ex

        return db_api.acquire_lock(db_models.WorkflowExecution, self.wf_ex.id)