LINQ to SQL DB Connections not closing
- by Joe
I am using LINQ to SQL in an asp.net mvc application. I am calling stored procedures via ajax calls.
The active connections for 2-3 users goes to 100 active connections. and then server timeouts happen.
I then used IOC -autofac to resuse the same repository that has a datacontext. now tho i get an active connection on the SQL server per loggedin user plus one.
I have never seen this before.
Why wouldnt Lin2sql not drop a connection when not in use?
would calling a stored procedure in an ajax call in a loggedin session creat an a new active connection?
Could a Stored Procedure with loops and or a waitfor hold open a connection??