Sql-server – Deadlock between two databases

deadlocksql serversql-server-2005

I have my code running online shared hosting provider. Recently I am seeing too many deadlock exception is being thrown. As you know that shared hosting uses the same database server to host all the databases, I am thinking does other database is running in same server blocking the resource that required for my database query to run. It sounds like stupid. But I have little knowledge on this matter. We are using MS-SQL server2005 and application written in .net framework 2.0. I am not sure about the Windows Server running.

I hope I had enough information here. Please let me know if you need more information.

Does deadlock occurs between two or more databases?

Best Answer

If you are only accessing your database, it is highly unlikely that deadlocks you are experiencing are caused by other customers that happen to have their database on the same server - they'd have to be intentionally crossing database boundaries with transactions, and they'd most certainly not have the ability to do that. However we need a lot more information about what kind of deadlocks you are seeing, as they could involve system objects, etc. Are the objects involved only in your database? Have you looked at the deadlock graphs at all, or are you just responding to "deadlock victim" messages? Lots of info in this StackOverflow question about interpreting deadlocks, but you need to capture the graph using Profiler or some kind of monitoring tool (for which you may need to ask the host's assistance).