As reported In #6100 a database exception occurred when attempting to store duplicate Summary Value rows in an imported emission report. Although the exception prevented the loading of the emission report into the database, the messaging to the user indicated that the import was successful. Although, #6203 will prevent the specific issue that caused the database exception in #6100, the import processes will need logic to capture and report database errors that are not prevented by checks before pushing the import to the database.
Needed Changes
Ensure that during any import, database exceptions are captured by the API/application and reported to the user.
This should include the following:
Emission (EM) Import from JSON
Monitoring Plan (MP) Import from JSON
QA Test (QAT) Import from JSON
QA Cert Event (QCE) Import from JSON
Test Extension and Exemption (TEE) Import from JSON
Acceptance Test (add more tests if applicable)
The issue with testing this change is that the known problem that will cause it will likely be resolved by #6203. That involves importing a JSON emissions file that contains summaryValue objects for the same location with the same parameterCode value. The triggers a constraint error that prevents SUMMARY_VALUE rows with the same MON_LOC_ID, RPT_PERIOD_ID, and PARAMETER_CD.
Testing this problem will likely require using the following method:
For each import type, select a table that is affected by the target import type ( EM, MP, QAT, QCE and TEE).
Temporarily add a constraint (likely a check constraint) that does not affect current workspace data, can be created in the import JSON.
The error identified in ticket #6100 originates from the bulk load service, The error’s invisibility to users is because it is in easey-common package. The bulk load service used only in emission API (EM).
Background
As reported In #6100 a database exception occurred when attempting to store duplicate Summary Value rows in an imported emission report. Although the exception prevented the loading of the emission report into the database, the messaging to the user indicated that the import was successful. Although, #6203 will prevent the specific issue that caused the database exception in #6100, the import processes will need logic to capture and report database errors that are not prevented by checks before pushing the import to the database.
Needed Changes
Ensure that during any import, database exceptions are captured by the API/application and reported to the user.
This should include the following:
Acceptance Test (add more tests if applicable)
The issue with testing this change is that the known problem that will cause it will likely be resolved by #6203. That involves importing a JSON emissions file that contains summaryValue objects for the same location with the same parameterCode value. The triggers a constraint error that prevents SUMMARY_VALUE rows with the same MON_LOC_ID, RPT_PERIOD_ID, and PARAMETER_CD.
Testing this problem will likely require using the following method: