LINQ to SQL DB Connections not closing

Posted by Joe on Stack Overflow See other posts from Stack Overflow or by Joe
Published on 2010-12-31T20:46:30Z Indexed on 2010/12/31 20:54 UTC
Read the original article Hit count: 170

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.

  1. Why wouldnt Lin2sql not drop a connection when not in use?
  2. would calling a stored procedure in an ajax call in a loggedin session creat an a new active connection?
  3. Could a Stored Procedure with loops and or a waitfor hold open a connection??

© Stack Overflow or respective owner

Related posts about asp.net-mvc

Related posts about AJAX