473,231 Members | 1,743 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,231 software developers and data experts.

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 5677
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
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
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
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
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
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
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
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
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
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
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...

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.