Symptom
Migration Fails on Schema Upgrade to 11.13.1.0
Error message:
Detailed Exception Information:
The task 'Upgrade schema to version 11.13.1.0' failed. Details of the error are included below.
System.InvalidOperationException
================================
This SqlTransaction has completed; it is no longer usable.
Program Location:
at System.Data.SqlClient.SqlTransaction.ZombieCheck()
at System.Data.SqlClient.SqlTransaction.Rollback()
at Preactor.StorageMapping.SchemaUpgradeTask.RunImpl()
at Preactor.Task.Run()
at Preactor.StorageMapping.SchemaUpgradeTask.Run()
at Preactor.WinForms.Controls.TaskRunner.TaskRunner.a(Object A_0, DoWorkEventArgs A_1)
This SqlTransaction has completed; it is no longer usable.
Cause
Package migration encounters an issue when trying to delete a large SecondaryResourceAnalysis table in the schema update system.
Resolution
The work around is to run the following SQL statement against the database:
DELETE FROM ScheduleAnalysis.PrimaryResourceAnalysis
WHERE ScheduleAnalysis.PrimaryResourceAnalysis.DatasetId NOT IN (SELECT dataset_id FROM dbo.DatasetsSequencerOperations)
DELETE FROM ScheduleAnalysis.SecondaryResourceAnalysis
WHERE ScheduleAnalysis.SecondaryResourceAnalysis.DatasetId NOT IN (SELECT dataset_id FROM dbo.DatasetsSequencerOperations)