Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow lower case error message to also trigger retry #2693

Conversation

rbhman
Copy link
Contributor

@rbhman rbhman commented May 31, 2021

Example error message:

2021-05-31 12:29:30.142 [http-nio-8080-exec-4] ERROR o.h.e.j.batch.internal.BatchingBatch [BatchingBatch.java:130] HHH000315: Exception executing batch [java.sql.BatchUpdateException: Batch entry 0 insert into hfj_tag_def (tag_code, tag_display, tag_system, tag_type, tag_id) values ('http://hl7.org/fhir/us/mcode/StructureDefinition/mcode-cancer-related-medication-statement', NULL, 'https://github.com/hapifhir/hapi-fhir/ns/jpa/profile', 1, 653) was aborted: ERROR: duplicate key value violates unique constraint "idx_tagdef_typesyscode" Detail: Key (tag_type, tag_system, tag_code)=(1, https://github.com/hapifhir/hapi-fhir/ns/jpa/profile, http://hl7.org/fhir/us/mcode/StructureDefinition/mcode-cancer-related-medication-statement) already exists. Call getNextException to see other errors in the batch.], SQL: insert into hfj_tag_def (tag_code, tag_display, tag_system, tag_type, tag_id) values (?, ?, ?, ?, ?)

@rbhman
Copy link
Contributor Author

rbhman commented May 31, 2021

I have tested this with my own multi-threaded environment (using med stmts only), where I run the following SQL before the test:

delete from public.hfj_history_tag where tag_id in (select tag_id from public.hfj_tag_def where tag_code like '%medication-statement%'); delete from public.hfj_res_tag t where tag_id in (SELECT distinct(tag_id) FROM public.hfj_res_tag t WHERE res_type = 'MedicationStatement'); delete from public.hfj_tag_def where tag_code like '%medication-statement%';

@rbhman
Copy link
Contributor Author

rbhman commented Jun 1, 2021

2021-06-01 10:06:05.858 [http-nio-8080-exec-22] ERROR o.h.e.j.batch.internal.BatchingBatch [BatchingBatch.java:130] HHH000315: Exception executing batch [java.sql.BatchUpdateException: Batch entry 0 insert into hfj_res_ver (partition_date, partition_id, res_deleted_at, res_version, has_tags, res_published, res_updated, res_encoding, res_text, res_id, res_type, res_ver, pid) values (NULL, NULL, NULL, 'R4', 'TRUE', '2021-04-19 13:51:32.049-04', '2021-06-01 10:06:04.952-04', 'JSONC', 2054145, 502643, 'Procedure', 12, 591453) was aborted: ERROR: duplicate key value violates unique constraint "idx_resver_id_ver" Detail: Key (res_id, res_ver)=(502643, 12) already exists. Call getNextException to see other errors in the batch.], SQL: insert into hfj_res_ver (partition_date, partition_id, res_deleted_at, res_version, has_tags, res_published, res_updated, res_encoding, res_text, res_id, res_type, res_ver, pid) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)

@jamesagnew
Copy link
Collaborator

Thanks for the contribution! Looks good.

@jamesagnew jamesagnew merged commit dfde993 into hapifhir:master Jun 1, 2021
jamesagnew added a commit that referenced this pull request Jun 1, 2021
@rbhman rbhman deleted the Avoid_tag_definition_constraints_#2620_lower_case branch June 1, 2021 18:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants