473,385 Members | 1,343 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Problem with connection pool

DaM
Hi guys,

I'm having this problem with my ASP.Net application:

I was testing the whole site, and it seem to work fine. Fast and
stable, but suddenly it stopped working and this error occurred:

"Timeout expired. The timeout period elapsed prior to obtaining a
connection from the pool. This may have occurred because all pooled
connections were in use and max pool size was reached."

What could be the cause? Every time I use a dataReader I'm pretty sure
I'm closing it.

Thanks in advance,
Dam

Nov 19 '05 #1
5 3016
Hi,

Seems all connections in the pool are in use. You can control the number of
connections in the pool changing connection string. For MSSQL, use mix pool
size= and max pool size=
Visit
http://msdn.microsoft.com/library/de...taprovider.asp
for more info. Also make sure you're closing reader/connection as soon as
the data has been populated/retreived.
--
Milosz Skalecki
MCP, MCAD
"DaM" wrote:
Hi guys,

I'm having this problem with my ASP.Net application:

I was testing the whole site, and it seem to work fine. Fast and
stable, but suddenly it stopped working and this error occurred:

"Timeout expired. The timeout period elapsed prior to obtaining a
connection from the pool. This may have occurred because all pooled
connections were in use and max pool size was reached."

What could be the cause? Every time I use a dataReader I'm pretty sure
I'm closing it.

Thanks in advance,
Dam

Nov 19 '05 #2
Make sure you are closing both your connection and your datareader.

Make sure you are doing this in the Finally block

run sp_who in SQL Server to see who's connected

Check out:
http://www.15seconds.com/issue/040830.htm

for more ideas...

Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/ - New and Improved (yes, the popup is annoying)
http://www.openmymind.net/faq.aspx - unofficial newsgroup FAQ (more to
come!)
"DaM" <dl******@gmail.com> wrote in message
news:11**********************@o13g2000cwo.googlegr oups.com...
Hi guys,

I'm having this problem with my ASP.Net application:

I was testing the whole site, and it seem to work fine. Fast and
stable, but suddenly it stopped working and this error occurred:

"Timeout expired. The timeout period elapsed prior to obtaining a
connection from the pool. This may have occurred because all pooled
connections were in use and max pool size was reached."

What could be the cause? Every time I use a dataReader I'm pretty sure
I'm closing it.

Thanks in advance,
Dam

Nov 19 '05 #3
Sorry, not "mix pool size" but "max pool size" :D
--
Milosz Skalecki
MCP, MCAD
"Milosz Skalecki" wrote:
Hi,

Seems all connections in the pool are in use. You can control the number of
connections in the pool changing connection string. For MSSQL, use mix pool
size= and max pool size=
Visit
http://msdn.microsoft.com/library/de...taprovider.asp
for more info. Also make sure you're closing reader/connection as soon as
the data has been populated/retreived.
--
Milosz Skalecki
MCP, MCAD
"DaM" wrote:
Hi guys,

I'm having this problem with my ASP.Net application:

I was testing the whole site, and it seem to work fine. Fast and
stable, but suddenly it stopped working and this error occurred:

"Timeout expired. The timeout period elapsed prior to obtaining a
connection from the pool. This may have occurred because all pooled
connections were in use and max pool size was reached."

What could be the cause? Every time I use a dataReader I'm pretty sure
I'm closing it.

Thanks in advance,
Dam

Nov 19 '05 #4
Hi Dam,

First of all, "pretty sure" is never sure enough! But let's assume for a
moment that you ARE closing all of your DataReaders.

There are a limited number of database connections available in any
Connection Pool. These Connections are created as needed, until the Maximum
Pool Size is reached. There is one Connection Pool created for each unique
Connection String used. When a database operation is requested, the
Connection String used is checked against the available Connection Pools. If
an existing Connection is available, it is re-used. If there are no
Connections available, the request is queued until either a Connection is
released, or the Timeout period expires.

A Connection is released not by closing a DataReader only, but by closing a
Connection object. Closing a DataReader releases the Connection object from
the DataReader, but does not close it. A Connection is released when you
call Close or Dispose on the Connection object.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
Neither a follower nor a lender be.

"DaM" <dl******@gmail.com> wrote in message
news:11**********************@o13g2000cwo.googlegr oups.com...
Hi guys,

I'm having this problem with my ASP.Net application:

I was testing the whole site, and it seem to work fine. Fast and
stable, but suddenly it stopped working and this error occurred:

"Timeout expired. The timeout period elapsed prior to obtaining a
connection from the pool. This may have occurred because all pooled
connections were in use and max pool size was reached."

What could be the cause? Every time I use a dataReader I'm pretty sure
I'm closing it.

Thanks in advance,
Dam

Nov 19 '05 #5
You can always use ExecuteReader(CommandBehaviour.Close) to close connection
automatically when calling IdbDataReader.Close().

--
Milosz Skalecki
MCP, MCAD
"Kevin Spencer" wrote:
Hi Dam,

First of all, "pretty sure" is never sure enough! But let's assume for a
moment that you ARE closing all of your DataReaders.

There are a limited number of database connections available in any
Connection Pool. These Connections are created as needed, until the Maximum
Pool Size is reached. There is one Connection Pool created for each unique
Connection String used. When a database operation is requested, the
Connection String used is checked against the available Connection Pools. If
an existing Connection is available, it is re-used. If there are no
Connections available, the request is queued until either a Connection is
released, or the Timeout period expires.

A Connection is released not by closing a DataReader only, but by closing a
Connection object. Closing a DataReader releases the Connection object from
the DataReader, but does not close it. A Connection is released when you
call Close or Dispose on the Connection object.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
Neither a follower nor a lender be.

"DaM" <dl******@gmail.com> wrote in message
news:11**********************@o13g2000cwo.googlegr oups.com...
Hi guys,

I'm having this problem with my ASP.Net application:

I was testing the whole site, and it seem to work fine. Fast and
stable, but suddenly it stopped working and this error occurred:

"Timeout expired. The timeout period elapsed prior to obtaining a
connection from the pool. This may have occurred because all pooled
connections were in use and max pool size was reached."

What could be the cause? Every time I use a dataReader I'm pretty sure
I'm closing it.

Thanks in advance,
Dam


Nov 19 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Mahesh D. Rane | last post by:
Hi, I am connecting to sql databse from windows C# form. when i close the form, then also the connection to databse is active. Its not allowing me to delete the database. But if i close the...
7
by: David Sworder | last post by:
Hi, I'm developing an application that will support several thousand simultaneous connections on the server-side. I'm trying to maximize throughput. The client (WinForms) and server communicate...
3
by: Suhail Salman | last post by:
Dear All, i got the following error message in an applications that opens 13 threads and all of them calling a stored procedure which retreieves data from SQLServer and fills them to a table the...
11
by: pradeep_TP | last post by:
Hi all, I have a few questions that I have been wanting to ask for long. These are all related to ADO.net and specifically to conenction to database. 1) If I have opened a connection to a...
8
by: ra294 | last post by:
I have an ASP.net application using SQL Server 2000 that every once in a while I am getting this error: "System.InvalidOperationException: Timeout expired. The timeout period elapsed prior to...
1
by: mingki | last post by:
Hi Developers, I am a .Net developer of a Large Online Retailling Company. I would like to have your help on a Connection Pool issue. Recently we have developed a Web Application on ODP .Net...
2
by: PH | last post by:
Hi; I got an application written in ASP.NET (VB.NET and C#) that uses connection pooling. The Max connections defined in the connection command are 50, and there are no more than 3 or 4 user...
10
by: Steven Blair | last post by:
As I understand it, if I create a connection object in my application and close the connection, the next time I open a connection with the same connection string I should be using a pooled...
2
by: RyoSaeba | last post by:
Hello, I have a problem with the session state set to Sql Server (AspNet 1.1, Windows Server 2003 on an Application Center cluster, Sql Server 2000 on another server). Sometimes, when many user...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.