473,405 Members | 2,349 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,405 software developers and data experts.

Big trouble with connections

In my application I close all the connections but a few ones that I can´t so
I close them in this way:

miCommand.ExecuteReader (CommandBehavior.CloseConnection);

From time to time I see an error message saying more or less that "the wait
time has expired before get a connection to the group. This may occur
because all the connections of the group was in use and maximum size of the
group was reached".

How can I solve this?

Thank you very much
Nov 16 '05 #1
3 1213
Hi Alberto
Try from you connection string, in the connection pooling options to
increase the pool size. Hope this helps

Mohamed Mahfouz
MEA Developer Support Center
ITworx on behalf of Microsoft EMEA GTSC

Nov 16 '05 #2

"Alberto" <al*****@nospam.terra.es> wrote in message
news:Ol*************@TK2MSFTNGP11.phx.gbl...
In my application I close all the connections but a few ones that I can´t so I close them in this way:

miCommand.ExecuteReader (CommandBehavior.CloseConnection);
This alone does not close the connection. The connection is closed (or
returned to the connection pool if you have pooling on) only after you call
Close or Dispose on the SqlDataReader.

As a side-note, whenever I suspect there is a connection leak somewhere I
first check that SqlDataReaders are closed properly, and more often than not
it turns out that a programmer forgets to Close the datareader. And even in
the case that the code calls Close, many times the code is not exception
safe which is almost as bad as not calling Close in the first place.

This is also the reason why SqlDataReaders should never be returned from a
data access layer component, as IMO it is way too easy to get it wrong.

Sorry for the rant,
Sami

From time to time I see an error message saying more or less that "the wait time has expired before get a connection to the group. This may occur
because all the connections of the group was in use and maximum size of the group was reached".

How can I solve this?

Thank you very much

Nov 16 '05 #3
Thank you very, very much. After close all the DataReader the problem was
solved.
"Sami Vaaraniemi" <sa**********@pleasejippii.fi> escribió en el mensaje
news:cl**********@phys-news1.kolumbus.fi...

"Alberto" <al*****@nospam.terra.es> wrote in message
news:Ol*************@TK2MSFTNGP11.phx.gbl...
In my application I close all the connections but a few ones that I can´t

so
I close them in this way:

miCommand.ExecuteReader (CommandBehavior.CloseConnection);


This alone does not close the connection. The connection is closed (or
returned to the connection pool if you have pooling on) only after you
call
Close or Dispose on the SqlDataReader.

As a side-note, whenever I suspect there is a connection leak somewhere I
first check that SqlDataReaders are closed properly, and more often than
not
it turns out that a programmer forgets to Close the datareader. And even
in
the case that the code calls Close, many times the code is not exception
safe which is almost as bad as not calling Close in the first place.

This is also the reason why SqlDataReaders should never be returned from a
data access layer component, as IMO it is way too easy to get it wrong.

Sorry for the rant,
Sami

From time to time I see an error message saying more or less that "the

wait
time has expired before get a connection to the group. This may occur
because all the connections of the group was in use and maximum size of

the
group was reached".

How can I solve this?

Thank you very much


Nov 16 '05 #4

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

Similar topics

3
by: Mudge | last post by:
Hi, My hosting provider only allows me to use 50 connections to my MySQL database that my Web site will use. I don't know what this 50 connections means exactly. Does this mean that only 50...
4
by: Angelos | last post by:
I get this error mysql_pconnect Too many connections ... every now and then. Does anyone knows where it comes from ? There are a lot of sites running on the server and all of them use the...
2
by: Bob | last post by:
We have a production web site that's data intensive (save user input to DB and query for displaying) with the ASP.NET app part on one W2K server and SQL 2000 DB on another W2K server. I have set...
1
by: Jim Bancroft | last post by:
Hi everyone, I'm running into a problem with my ASP.Net application. I've just created a new aspx page which uses some new components of mine that inherit from ServicedComponent and are...
17
by: Peter Proost | last post by:
Hi Group, I've got an interesting problem, I don't know if this is the right group but I think so because everything I've read about it so far says it's a .net problem. Here's the problem, we're...
5
by: Usman Jamil | last post by:
Hi I've a class that creates a connection to a database, gets and loop on a dataset given a query and then close the connection. When I use netstat viewer to see if there is any connection open...
10
by: daschicken | last post by:
Hi guys, ive written the following method. its supposed to delete objects in a LinkedList. These objects implicit Connections to other objects. if one object is deleted all the connections in...
0
by: mrchatgroup | last post by:
news from http://www.mrchat.net/myblog/myblog/small-accidents-mean-big-trouble-for-supercollider.html Small Accidents Mean Big Trouble for Supercollider Image Scientists expect startup...
0
by: brum2008 | last post by:
Hello! Below is the Netbeans Mobility source code for my application (The application offers SPP service, and then just hangs waiting for a client to connect (using acceptAndOpen()). The other...
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: 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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...

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.