ProcessingEngineTasksデータベースのDefault CursorオプションがGLOBALに設定されている場合、SqlExceptionがスローされる可能性がある


解説

ProcessingEngineTasksデータベースのDefault CursorオプションがGLOBALに設定されている場合に、前提のタスクが失敗すると、タスクのアップデート中にSqlExceptionがスローされる可能性があります。

Tasks Database Screenshot

事象が発生すると、以下の例外がSitecore XPログに出力される可能性があります。

System.Data.SqlClient.SqlException : A cursor with the name 'DependentTasks' already exists.
The cursor is already open.
A cursor with the name 'DependentTasks' already exists.
  at System.Data.SqlClient.SqlCommand.<>c.<ExecuteDbDataReaderAsync>b__174_0(Task`1 result)
  at System.Threading.Tasks.ContinuationResultTaskFromResultTask`2.InnerInvoke()
  at System.Threading.Tasks.Task.Execute()

解決策

ProcessingEngineTasksデータベースで、UpdateTaskStatusByIdストアドプロシージャの次の行を、以下のように変更してください。

変更前:

DECLARE [DependentTasks] CURSOR FOR

変更後:

DECLARE [DependentTasks] CURSOR LOCAL FOR