CRITFC / Helpdesk

Parent repository for tribal CDMS documentation and issues
1 stars 0 forks source link

Problem saving multiple Water Temperature activities #53

Open tylerstright opened 3 years ago

tylerstright commented 3 years ago

Testing the new instruments functionality, I cannot save multiple activities. One activity will succeed while all others within the same import fail. Error message described a 'deadlock' and traced back to the ActivityController.cs, line 1104.

image

nowinski commented 3 years ago

This all seems to work fine when saving single activities but fails when multiple activities are saving. Possible solution commit the Activity transaction and then start a new transaction for the update to avoid a deadlock... Capture

Coinerc commented 2 years ago

Known issue of the multiple activities import. The system as of yet doesn't recognize different Instruments assigned. At present if must import activities assigned to a single instrument individually.

Coinerc commented 2 years ago

For programmer of the multiactivity import needs to have it address the instruments the same way it address the locations by assigning the correct instrument to each activity.

nowinski commented 2 years ago

This save issue was traced to the special UPDATE statement that copies MIN/MAX reading datetime into the Activity description field during the the save transaction. It works fine with one activity but deadlocks the database when multiple activities are saving simultaneously. The proposed solution is committing each activity transaction before running the UPDATE.

Regarding Locations and Instruments, we use the Duplicate Check key fields to define a composite key for each Activity. This allows the Javascript to group records as expected for all cases (not just for Locations and Instruments)