I have a .net 3.5 website that calls thousands of different stored processes using Microsoft.Practices.EnterpriseLibrary.
We get a lot of timeouts, and after some games and usage testing (nolock) at the end of the table, the connection in stored procs works fine and reduces timeouts.
I want to do this with all sps. I could add (nolock) to all table names, however it’s better to understand how to set the isolation level using SQL "SET SET TRANSACTION READ UNCOMMITTED"
I do not want to add this to the beginning of all sp (since there are so many), so he was looking for a way to add it to the connection.
Sample code for calling sp as follows
public static int ExecuteNonQuery(string sStoredProcedureName, params object[] parameterValues)
{
Data.Database db = Data.DatabaseFactory.CreateDatabase();
using (DbCommand command = db.GetStoredProcCommand(sStoredProcedureName, parameterValues))
{
return db.ExecuteNonQuery(command);
}
}
, web.config, , , .
.
Cheers Amjid