Currently, I have been conducting some experiments in the SQL Server 2008 database. More specifically, I have a JDBC application that uses hundreds of parallel threads to perform thousands of tasks, each of which performs the following query in the database:
UPDATE from Table A where rowID='123'
However, I get a ton of deadlock errors (SQL Exception 1205) when I set the isolation level above READ_UNCOMMITTED. This happens even if I set row locks, table locks and exclusive lock hints! And even in Snapshot Isolation, which does not use locks, I still get deadlock errors.
I skipped the trace through SQL Profiler to get a stub graph when this happens, but it was not very useful. He showed the victim process associated with the thread pool, linked by hundreds of other processes. You can check it out here:
http://i.stack.imgur.com/7rlv3.jpg
Does anyone have any hints why this is happening? Over the past few days, I have gone crazy trying to figure it out. My current hypothesis is that it is related to any available workflows in my DB instance, the amount of available memory, or something that is not related to the actual locks at the query level.
Thanks!
concurrency sql-server deadlock
akwok
source share