mercredi 25 mai 2016

NHibernate stored procedure timeout(deadlock?) SQL Server 2005

I have a stored procedure that I have to call which has a couple of Update statements in it.

I was running it using _session.CreateSQLQuery("exec procName @param1=:param1, @param2=:param2...")

I upgraded nhibernate(after 5 years) and now this times out, although the stored procedure executes immediately in SSMS. At first I suspected it to be parameter sniffing, so I went to the SQL Profiler and grabbed all the connection information and set that on the SSMS connection and running the exact query nhibernate sent to SQL Server(execute_sql query), it executed successfully immediately. I also tried clearing out the Proc Cache for the DB in case of corrupted query plans.

I then executed the SP using ADO.NET with no interaction with NHibernate at all and it executes successfully, which lead me to believe it is some sort of blocking/deadlocking issue, but the profiler doesn't show any deadlocking/blocking happening. I'm running a transaction per request.

Running NHibernate v4.0.0.4000, SQL Server 2005, ASP.NET MVC 5

Anyone have any ideas where I should go from here before I light my hair on fire?

Aucun commentaire:

Enregistrer un commentaire