G
Guest
OK. Here we go. I have an ASP.NET application that does many hits to a SQL Server DB on a separate server. When I first created this application (2 years ago) and was very new to ASP/ASP.NET, to make the SQL connection string global throughout the application I created a .vb file within the application project and declared a public SQLConnection:
Public ors_wnf As SqlConnection = New SqlConnection("SERVER=ZEUS;UID=wnfdbuser;PWD=******;DATABASE=EZPrice;")
This works fine functionally, but I know its not the best way to do this. Also, a few times a day when it gets real busy on the web server I get a aspnet_wp.exe error - "aspnet_wp.exe was recycled becasue it was suspected to be in a deadlocked state..." This error states that the 180 second timeout has been reached and hangs the web server. There are a few applications on this web server that connect to the SQL Server with their sqlconnections declared publicly the same way within each web app. However, the SQL Server is only running at around 10% when this deadlock occurs (the SQL commands are mostly basic selects), and the web server is only running at about 25%. And, I am not using multiple threads within each web application. This deadlock issue is becoming a huge problem as we have a few hundred users on the intranet now.
Are these issues related?
What is the best way to use the sqlconnection within each session so I only have to declare it in one place?
Would DB connection pooling resolve the deadlock issue? I am thinking that the deadlock is happening from all the connections into the SQL Server.
Any insight would be greatly appreciated. Thanks.
Public ors_wnf As SqlConnection = New SqlConnection("SERVER=ZEUS;UID=wnfdbuser;PWD=******;DATABASE=EZPrice;")
This works fine functionally, but I know its not the best way to do this. Also, a few times a day when it gets real busy on the web server I get a aspnet_wp.exe error - "aspnet_wp.exe was recycled becasue it was suspected to be in a deadlocked state..." This error states that the 180 second timeout has been reached and hangs the web server. There are a few applications on this web server that connect to the SQL Server with their sqlconnections declared publicly the same way within each web app. However, the SQL Server is only running at around 10% when this deadlock occurs (the SQL commands are mostly basic selects), and the web server is only running at about 25%. And, I am not using multiple threads within each web application. This deadlock issue is becoming a huge problem as we have a few hundred users on the intranet now.
Are these issues related?
What is the best way to use the sqlconnection within each session so I only have to declare it in one place?
Would DB connection pooling resolve the deadlock issue? I am thinking that the deadlock is happening from all the connections into the SQL Server.
Any insight would be greatly appreciated. Thanks.