Skip to content
Advertisement

Deadlock Exception during select

I am trying to solve a deadlock exception in a spring-boot application running with JPA. I get the following error in the spring boot log.

When I go to SSMS log and look at the deadloack error report I see the following

The odd thing is it seems to lock during multiple select queries, while I thought this should only happen during a select – insert/update

UPDATE:

Based on the comments below, I have also added the Hibernate query log which actually shows a bunch of inserts and selects happening in parallel

Does anyone have any insight on solving this?

Advertisement

Answer

Based on the comments to the comment, some some further research by the author, the actual deadlock was bypassed by setting the isolation level to READ_UNCOMMITED

https://www.sqlservercentral.com/articles/isolation-levels-in-sql-server

While this is not recommended for every usecase, for this particular scenario it was good enough

User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement