473,499 Members | 1,886 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Timeout / Obtaining a connection from the pool - Please Help!

Dear Group

Sorry for posting this here. I'm desperate for a solution to this
problem and thought some of you might have come across it with .NET
and SQL Server.
Let's assume I've the following code:

Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button4.Click

Dim sqlConnection As New System.Data.SqlClient.SqlConnection

sqlConnection.ConnectionString = "workstation id=THEINTREPIDFOX;packet
size=4096;user id=sa;data source=""(local)"";p" & _
"ersist security info=False;initial catalog=TestDB"

sqlConnection.Open()
sqlConnection.Close()
sqlConnection = Nothing

End Sub

When I click 100 times on the button the page finally times out with:

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.

Of course I could increase the max pool size but this isn't the
solution to this problem. I wonder what's wrong with my code?
According to MSDN, if the connection is closed it's released back into
the pool. Also tried to dispose but nothing helps. It looks like that
it keeps connections and doesn't release them. I'm grateful for any
hints, ideas, suggestions on this problem as I'm very desperate to
solve this.

Thanks very much for your time & efforts!

Martin
Jul 20 '05 #1
5 5691
Martin (th************@hotmail.com) writes:
Sorry for posting this here. I'm desperate for a solution to this
problem and thought some of you might have come across it with .NET
and SQL Server.


I don't have an answer, but then again, this is an SQL Server
newsgroup and not an .Net group. There are specific groups for ADO
..Net, at least in microsoft.public.*. You might have better luck
there.
--
Erland Sommarskog, SQL Server MVP, so****@algonet.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinf...2000/books.asp
Jul 20 '05 #2
"Martin" <th************@hotmail.com> wrote in message
news:72**************************@posting.google.c om...
| Dear Group
|
| Sorry for posting this here. I'm desperate for a solution to this
| problem and thought some of you might have come across it with .NET
| and SQL Server.
| Let's assume I've the following code:
|
| Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As
| System.EventArgs) Handles Button4.Click
|
| Dim sqlConnection As New System.Data.SqlClient.SqlConnection
|
| sqlConnection.ConnectionString = "workstation id=THEINTREPIDFOX;packet
| size=4096;user id=sa;data source=""(local)"";p" & _
| "ersist security info=False;initial catalog=TestDB"
|
| sqlConnection.Open()
| sqlConnection.Close()
| sqlConnection = Nothing
|
| End Sub
|
| When I click 100 times on the button the page finally times out with:
|
| 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.
|
| Of course I could increase the max pool size but this isn't the
| solution to this problem. I wonder what's wrong with my code?
| According to MSDN, if the connection is closed it's released back into
| the pool. Also tried to dispose but nothing helps. It looks like that
| it keeps connections and doesn't release them. I'm grateful for any
| hints, ideas, suggestions on this problem as I'm very desperate to
| solve this.
|
| Thanks very much for your time & efforts!
|
| Martin
Martin,

Hope this helps:

http://support.microsoft.com/default...b;en-us;308047

Dan

Jul 20 '05 #3
Daniel A. Thomas (dathomas@--spam--istar.ca) writes:
Hope this helps:

http://support.microsoft.com/default...b;en-us;308047


This article describes to open an ADO record set from .Net. It seems
to me that Martin was having problems with SqlClient ADO .Net. ADO
and ADO .Net may have similar-looking names, but they are very different.
:-)
--
Erland Sommarskog, SQL Server MVP, so****@algonet.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinf...2000/books.asp
Jul 20 '05 #4
"Martin" <th************@hotmail.com> wrote in message
news:72**************************@posting.google.c om...
| Dear Group
|
| Sorry for posting this here. I'm desperate for a solution to this
| problem and thought some of you might have come across it with .NET
| and SQL Server.
| Let's assume I've the following code:
|
| Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As
| System.EventArgs) Handles Button4.Click
|
| Dim sqlConnection As New System.Data.SqlClient.SqlConnection
|
| sqlConnection.ConnectionString = "workstation id=THEINTREPIDFOX;packet
| size=4096;user id=sa;data source=""(local)"";p" & _
| "ersist security info=False;initial catalog=TestDB"
|
| sqlConnection.Open()
| sqlConnection.Close()
| sqlConnection = Nothing
|
| End Sub
|
| When I click 100 times on the button the page finally times out with:
|
| 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.
|
| Of course I could increase the max pool size but this isn't the
| solution to this problem. I wonder what's wrong with my code?
| According to MSDN, if the connection is closed it's released back into
| the pool. Also tried to dispose but nothing helps. It looks like that
| it keeps connections and doesn't release them. I'm grateful for any
| hints, ideas, suggestions on this problem as I'm very desperate to
| solve this.
|
| Thanks very much for your time & efforts!
|
| Martin

Hi Martin,

As Erland Sommarskog pointed out I've pointed you to ADO and not
ADO.NET Sorry 'bout that one. So first things first remove the
ADO coding "sqlConnection = Nothing".

Here is the working hypothesis ...
As your connect strings specifies "Persist Security Info=False;"(default=
false)security information is never returned. In addition, Integrated
Security is
false by default and when false, User ID and Password are specified in the
connection. The result is an exact match with an existing connection pool
object
is never possible and the connections in the pool are not being reused.

You might try adding "Integrated Security=SSPI;" to your connect string.
When set to "SSPI" Windows account credentials are used for
authentication.

If this unacceptable add "Pooling=False;" to your connect string. This
defeats
the performance enhancements of connection pooling but the Timeout error
will go.

Some of this information is contained in the following two articles at:

http://msdn.microsoft.com/library/de...tringTopic.asp

http://msdn.microsoft.com/library/de...taprovider.asp

Of course there's always plain old vanilla ADO.

:-)
Dan

Jul 20 '05 #5
Thanks guys for having a look at this anyway!
M
Jul 20 '05 #6

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

Similar topics

0
1760
by: Silvia | last post by:
I have a application web and when execute this for a long time generated this error: Server Error in '/RAIMServer' Application. -----------------------------------------------------------...
3
11080
by: Kamalanathan T. | last post by:
Hi, We have developed an Web application in ASP.NET with C# and we r using SQL Server 2000. We get the Timeout expired error, when more than 300 concurrent users hit the site. I hagone thru...
1
1132
by: Martin | last post by:
Dear Group I'm desperate for a solution to this problem. Let's assume I've the following code: Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles...
4
23158
by: Guoqi Zheng | last post by:
Dear sir, I keep getting the following errors on one of my sites after clicking for many times. Timeout expired. The timeout period elapsed prior to obtaining a connection from the pool. This...
4
4347
by: Nevyn Twyll | last post by:
I've been working on an asp.net application and everything's been great. But suddenly, whether I'm tyring to use a database on my own machine, or on my server, I'm getting a timeout when trying to...
1
1742
by: UJ | last post by:
We have recently started getting the following error message: Timeout expired. The timeout period elapsed prior to obtaining a connection from the pool. This may have occurred because all pooled...
1
11038
by: Jake K | last post by:
I have a system timer that elapses every 10 seconds and must execute every ten seconds. Basically every 10 seconds I need to insert into a table. The following code, however, causes a "Timeout...
7
2740
by: =?Utf-8?B?Sm9obiBTdGFnZ3M=?= | last post by:
Hello, Please read this all before giving an answer :) I'm doing some troubleshooting on a web application that my company wrote. It's written in asp.net 1.1. The error that the Event viewer...
2
12599
by: anumsajeel | last post by:
Hi, Error Message:- error connecting: Timeout expired. The timeout period elapsed prior to obtaining a connection from the pool. This may have occurred because all pooled connections were...
0
7131
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
7174
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
7220
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...
1
6894
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7388
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
4600
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3091
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
665
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
297
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.