connection pool errors

P

Phil Townsend

While we have switched to the Application.Data block to improve
connection management, we are still experiencing connection pool errors
on occasions. I have been careful to explicitly close connections.
Furthermore, for added insurance, I am calling close() and dispose() on
the connection object that is passed to the SqlHelper method. Still I am
getting connection pool errors. Is there anything that I may be
overlooking? Is there any way to manually flush the connection pool in
code? Thanks!
 
N

Nick Malik [Microsoft]

You described your efforts to fix the problem, but not really the problem
itself.

a) what error messages are you getting?
b) what conditions give rise to the errors?

I'd like to help.

--
--- Nick Malik [Microsoft]
MCSD, CFPS, Certified Scrummaster
http://blogs.msdn.com/nickmalik

Disclaimer: Opinions expressed in this forum are my own, and not
representative of my employer.
I do not answer questions on behalf of my employer. I'm just a
programmer helping programmers.
 
P

Phil Townsend

This is part of an online exam for state employees. There is a page for
questions with a 'Next' button to continue to the next question.

Each time the 'Next' button is clicked, the current question is graded.
Each time the questions page is loaded, there a connection made to
return datasets for questions, & answers, with a seperate connection for
each ExecuteDataset method.

When the next question is requested, the current question is graded
through a stored procedure that updates a table. At the end of the exam,
the exam is automatically graded through a stored procedure that checks
all the answers and if all are correct, they are deleted and the user is
flagged as having passed the exam. This stored procedure uses a cursor
to loop through all the user's answers.

At this point they must move on to the next exam which operates from the
same web forms. Half way through the second exam, the application fails
with the error: System.InvalidOperationException and a message that the
Timeout has expired because all connections were used and the max size
of the pool has been reached. As mentioned before, I am taking extra
precautions to make sure that connections are disposed of. However, it
was my understanding that the Application.Data block was supposed to
address connection management problems like these. It appears not.
Thanks for your help!
 
N

Nick Malik [Microsoft]

First off, in your connection string to the database, are you (a) using SQL
logins, or (b) is your site impersonating a single domain user, or (c) are
you passing the credentials of the state employee straight through to the
database?

Secondly, what version of the OS are you running the web site on?

Thirdly, what version of the framework are you using?

Fourth, does this only happen under load (on the production web server) or
can you repro this in your dev environment?

Fifth, when you say this > seperate connection for each ExecuteDataset
method. <
Are you creating all of your connections at the same time, and then using
them one by one, or are you simply refreshing the connection between calls
of ExecuteDataset?

--
--- Nick Malik [Microsoft]
MCSD, CFPS, Certified Scrummaster
http://blogs.msdn.com/nickmalik

Disclaimer: Opinions expressed in this forum are my own, and not
representative of my employer.
I do not answer questions on behalf of my employer. I'm just a
programmer helping programmers.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top