In the project my team is working on we are encountering a lot of deadlocks. The project is using the spring framework and JPA as an ORM. When looking at the deadlocks occurring on our T-SQL database, it appears that most of them occur from page locks on queries that are generated by JPA. We have moved many queries over to stored procedures that are called and that solves a lot of the deadlocks happening.
I am assuming there is something wrong with our schema or the way we are doing things that is causing page locks to occur. The update statements where the page locks happen have unique ids in the predicate. Below is an example of the deadlock xdl/xml.
I am happy to provide more information as it's needed.