FHIR Chat · Deadlock exception on sql-server for hfj_forced_id table · hapi

Stream: hapi

Topic: Deadlock exception on sql-server for hfj_forced_id table


view this post on Zulip Sajith Jamal (Feb 19 2020 at 04:43):

Hi all,
I am trying to parse some resources to the to a HAPI server with a Sql Server backend. However some of the transactions fail with a deadlock exception...looking at the sql log...I can see that the lock is caused at the table hfj_forced_id

Enabling the Hibernate SQL logs on my app shows some inserts and writes on to the table at what seems to be the same time
forced_error.PNG

Scenario:
I have a few hundred bundles of PractitionerRole that I am trying to POST to the HAPI server in a parallel manner at about 50 bundles per second
Each bundle has a 100 PractitionerRoles

I presume this happens when creating a forced_id several times for the resources causing a deadlock.

Other types of databases did not cause this (tested on hsqldb and derby), so I think this is specific to the Sql Server Engine. However I am limited to using Sql Server due to circumstances so I would like to try to resolved this issue

I have also tried setting the transaction isolation level to read_uncommited to no avail at both the spring boot application level as well as the database level
spring.jpa.properties.hibernate.connection.isolation=READ_UNCOMMITED
SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED

@James Agnew do you perhaps have some insight into trying to solve this issue?

view this post on Zulip James Agnew (Feb 20 2020 at 16:41):

FYI to anyone- this discussion moved to the Google Group

view this post on Zulip Keith Boone (Feb 21 2020 at 18:51):

Link?

view this post on Zulip Patrick Werner (Feb 22 2020 at 10:43):

https://groups.google.com/forum/?utm_medium=email&utm_source=footer#!msg/hapi-fhir/lLuRnQZoaU8/soI1OtvDAQAJ


Last updated: Apr 12 2022 at 19:14 UTC