By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
425,971 Members | 907 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 425,971 IT Pros & Developers. It's quick & easy.

Published 'Personal WEB Site' problems

P: n/a
Developed this personal WEB site with the new ASP.NET 2.0 Beta:

http://www.techsoft.no/bendik/

It has got this problem: After a while browsing through pictures on the
site, an error occurs:

'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.'

My suspicions go in the direction of the PhotoManager. I see that its ctor
opens up a connection with the database. But I cannot see any closing of the
connection. I guess should be a C# garbage collection thing. It is supposed
to be closed when the connection is no longer in use, right ? Well, in my
case it doesn't seem to be closed appropriately, at least not in due time.
Only after a while of waiting (several minutes) can I get back into the
site. Some connections then probably have timed out.

Been struggling with it for a couple of days ow and getting really
frustrated. Is this a Beta bug maybe ? Has anyone else experienced this ?
How can I fix it - or get around it ?

Any clues appreciated!

Bendik
Nov 19 '05 #1
Share this Question
Share on Google+
5 Replies


P: n/a
The connection pool should only fill up if the connection string to the DB is
different on each use of a connection in code. Try using the same connection
string and an existing connection from the pool will be used.

"Bendik Engebretsen" wrote:
Developed this personal WEB site with the new ASP.NET 2.0 Beta:

http://www.techsoft.no/bendik/

It has got this problem: After a while browsing through pictures on the
site, an error occurs:

'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.'

My suspicions go in the direction of the PhotoManager. I see that its ctor
opens up a connection with the database. But I cannot see any closing of the
connection. I guess should be a C# garbage collection thing. It is supposed
to be closed when the connection is no longer in use, right ? Well, in my
case it doesn't seem to be closed appropriately, at least not in due time.
Only after a while of waiting (several minutes) can I get back into the
site. Some connections then probably have timed out.

Been struggling with it for a couple of days ow and getting really
frustrated. Is this a Beta bug maybe ? Has anyone else experienced this ?
How can I fix it - or get around it ?

Any clues appreciated!

Bendik

Nov 19 '05 #2

P: n/a
I haven't done anything to the connection strings used in the 'Personal WEB
Site Starter Kit'. In the source code of PhotoManager ctor it says
connection = new
SqlConnection(ConfigurationManager.ConnectionStrin gs["Personal"].ConnectionString);

So then it should be the same all the time, shouldn't it ? I admit that I am
an ASP newbie, so I do not understand that much of what is going on with the
database yet. I am just trying to figure out why my site won't run properly
from the server. Could it be a bu in SQL Server Express 2005 Beta which I am
using on the server ? Because it runs fine here when running locally on the
Visual Studio.NET 2005 Beta machine (XP Professional).

Bendik
"Brad Roberts" <Br*****************@hotmail.com> wrote in message
news:60**********************************@microsof t.com...
The connection pool should only fill up if the connection string to the DB
is
different on each use of a connection in code. Try using the same connection
string and an existing connection from the pool will be used.

"Bendik Engebretsen" wrote:
Developed this personal WEB site with the new ASP.NET 2.0 Beta:

http://www.techsoft.no/bendik/

It has got this problem: After a while browsing through pictures on the
site, an error occurs:

'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.'

My suspicions go in the direction of the PhotoManager. I see that its ctor
opens up a connection with the database. But I cannot see any closing of
the
connection. I guess should be a C# garbage collection thing. It is
supposed
to be closed when the connection is no longer in use, right ? Well, in my
case it doesn't seem to be closed appropriately, at least not in due time.
Only after a while of waiting (several minutes) can I get back into the
site. Some connections then probably have timed out.

Been struggling with it for a couple of days ow and getting really
frustrated. Is this a Beta bug maybe ? Has anyone else experienced this ?
How can I fix it - or get around it ?

Any clues appreciated!

Bendik

Nov 19 '05 #3

P: n/a
See : http://beta.asp.net/QUICKSTART/aspne.../retrieve.aspx
for detailed sample code you can use
to check the PhotoManager code you have.

View both the web.config and the using_connectionstrings.cs
source code, modify appropiately ( after backing up the original )
and test again.

Juan T. Llibre
ASP.NET MVP
ASP.NET FAQ : http://asp.net.do/faq/
==========================

"Bendik Engebretsen" <ba**********@hotmail.com> wrote in message
news:OJ**************@TK2MSFTNGP09.phx.gbl...
I haven't done anything to the connection strings used in the 'Personal WEB
Site Starter Kit'. In the source code of PhotoManager ctor it says
connection = new
SqlConnection(ConfigurationManager.ConnectionStrin gs["Personal"].ConnectionString);

So then it should be the same all the time, shouldn't it ? I admit that I am
an ASP newbie, so I do not understand that much of what is going on with the
database yet. I am just trying to figure out why my site won't run properly
from the server. Could it be a bu in SQL Server Express 2005 Beta which I am
using on the server ? Because it runs fine here when running locally on the
Visual Studio.NET 2005 Beta machine (XP Professional).

Bendik
"Brad Roberts" <Br*****************@hotmail.com> wrote in message
news:60**********************************@microsof t.com...
The connection pool should only fill up if the connection string to the DB
is
different on each use of a connection in code. Try using the same connection
string and an existing connection from the pool will be used.

"Bendik Engebretsen" wrote:
Developed this personal WEB site with the new ASP.NET 2.0 Beta:

http://www.techsoft.no/bendik/

It has got this problem: After a while browsing through pictures on the
site, an error occurs:

'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.'

My suspicions go in the direction of the PhotoManager. I see that its ctor
opens up a connection with the database. But I cannot see any closing of
the
connection. I guess should be a C# garbage collection thing. It is
supposed
to be closed when the connection is no longer in use, right ? Well, in my
case it doesn't seem to be closed appropriately, at least not in due time.
Only after a while of waiting (several minutes) can I get back into the
site. Some connections then probably have timed out.

Been struggling with it for a couple of days ow and getting really
frustrated. Is this a Beta bug maybe ? Has anyone else experienced this ?
How can I fix it - or get around it ?

Any clues appreciated!

Bendik


Nov 19 '05 #4

P: n/a
Thanx Juan! In my web.config I have the following connection string which is
used by the PhotoManager:

<add name="Personal" connectionString="Data Source=.\SQLExpress;Integrated
Security=True;User
Instance=True;AttachDBFilename=|DataDirectory|Pers onal.mdf"
providerName="System.Data.SqlClient"/>

As I said, I have not changed it since I create my site with the 'Personal
WEB Site Starter Kit'. But maybe I should, since I have now published the
site on our Windows 2003 server. On this server I have not installed the
Visual Studio.Net 2005 Beta. I have only installed the SQL Server Express
2005 Beta and .NET 2.0 Framework to make it work there.

Should I change my connection string ?

Bendik

"Juan T. Llibre" <no***********@nowhere.com> wrote in message
news:eN****************@TK2MSFTNGP12.phx.gbl...
See : http://beta.asp.net/QUICKSTART/aspne.../retrieve.aspx
for detailed sample code you can use
to check the PhotoManager code you have.

View both the web.config and the using_connectionstrings.cs
source code, modify appropiately ( after backing up the original )
and test again.

Juan T. Llibre
ASP.NET MVP
ASP.NET FAQ : http://asp.net.do/faq/
==========================

"Bendik Engebretsen" <ba**********@hotmail.com> wrote in message
news:OJ**************@TK2MSFTNGP09.phx.gbl...
I haven't done anything to the connection strings used in the 'Personal WEB
Site Starter Kit'. In the source code of PhotoManager ctor it says
connection = new
SqlConnection(ConfigurationManager.ConnectionStrin gs["Personal"].ConnectionString);

So then it should be the same all the time, shouldn't it ? I admit that I
am
an ASP newbie, so I do not understand that much of what is going on with
the
database yet. I am just trying to figure out why my site won't run
properly
from the server. Could it be a bu in SQL Server Express 2005 Beta which I
am
using on the server ? Because it runs fine here when running locally on
the
Visual Studio.NET 2005 Beta machine (XP Professional).

Bendik
"Brad Roberts" <Br*****************@hotmail.com> wrote in message
news:60**********************************@microsof t.com...
The connection pool should only fill up if the connection string to the DB
is
different on each use of a connection in code. Try using the same
connection
string and an existing connection from the pool will be used.

"Bendik Engebretsen" wrote:
Developed this personal WEB site with the new ASP.NET 2.0 Beta:

http://www.techsoft.no/bendik/

It has got this problem: After a while browsing through pictures on the
site, an error occurs:

'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.'

My suspicions go in the direction of the PhotoManager. I see that its
ctor
opens up a connection with the database. But I cannot see any closing of
the
connection. I guess should be a C# garbage collection thing. It is
supposed
to be closed when the connection is no longer in use, right ? Well, in my
case it doesn't seem to be closed appropriately, at least not in due
time.
Only after a while of waiting (several minutes) can I get back into the
site. Some connections then probably have timed out.

Been struggling with it for a couple of days ow and getting really
frustrated. Is this a Beta bug maybe ? Has anyone else experienced this ?
How can I fix it - or get around it ?

Any clues appreciated!

Bendik



Nov 19 '05 #5

P: n/a
Hi, Bendik.

If your problem is that you're having too many connections stay
open, then, no, you don't have to change youre connection string at all.

It working fine [ in fact, too well... ;-) ]

What I meant was check for where you would try to place the
connection.Close() ( in a Try / Finally clause )

See :

http://beta.asp.net/QUICKSTART/util/...ionStrings.src

try
{
// your Select statement
}
finally
{
connection.Close();
}

Juan T. Llibre
ASP.NET MVP
ASP.NET FAQ : http://asp.net.do/faq/
Foros de ASP.NET en Español : http://asp.net.do/foros/
Ven, y hablemos de ASP.NET...
======================

"Bendik Engebretsen" <ba**********@hotmail.com> wrote in message
news:eY**************@TK2MSFTNGP15.phx.gbl...
Thanx Juan! In my web.config I have the following connection string which is
used by the PhotoManager:

<add name="Personal" connectionString="Data Source=.\SQLExpress;Integrated
Security=True;User
Instance=True;AttachDBFilename=|DataDirectory|Pers onal.mdf"
providerName="System.Data.SqlClient"/>

As I said, I have not changed it since I create my site with the 'Personal
WEB Site Starter Kit'. But maybe I should, since I have now published the
site on our Windows 2003 server. On this server I have not installed the
Visual Studio.Net 2005 Beta. I have only installed the SQL Server Express
2005 Beta and .NET 2.0 Framework to make it work there.

Should I change my connection string ?

Bendik

"Juan T. Llibre" <no***********@nowhere.com> wrote in message
news:eN****************@TK2MSFTNGP12.phx.gbl...
See : http://beta.asp.net/QUICKSTART/aspne.../retrieve.aspx
for detailed sample code you can use
to check the PhotoManager code you have.

View both the web.config and the using_connectionstrings.cs
source code, modify appropiately ( after backing up the original )
and test again.

Juan T. Llibre
ASP.NET MVP
ASP.NET FAQ : http://asp.net.do/faq/
==========================

"Bendik Engebretsen" <ba**********@hotmail.com> wrote in message
news:OJ**************@TK2MSFTNGP09.phx.gbl...
I haven't done anything to the connection strings used in the 'Personal WEB
Site Starter Kit'. In the source code of PhotoManager ctor it says
connection = new
SqlConnection(ConfigurationManager.ConnectionStrin gs["Personal"].ConnectionString);

So then it should be the same all the time, shouldn't it ? I admit that I
am
an ASP newbie, so I do not understand that much of what is going on with
the
database yet. I am just trying to figure out why my site won't run
properly
from the server. Could it be a bu in SQL Server Express 2005 Beta which I
am
using on the server ? Because it runs fine here when running locally on
the
Visual Studio.NET 2005 Beta machine (XP Professional).

Bendik
"Brad Roberts" <Br*****************@hotmail.com> wrote in message
news:60**********************************@microsof t.com...
The connection pool should only fill up if the connection string to the DB
is
different on each use of a connection in code. Try using the same
connection
string and an existing connection from the pool will be used.

"Bendik Engebretsen" wrote:
Developed this personal WEB site with the new ASP.NET 2.0 Beta:

http://www.techsoft.no/bendik/

It has got this problem: After a while browsing through pictures on the
site, an error occurs:

'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.'

My suspicions go in the direction of the PhotoManager. I see that its
ctor
opens up a connection with the database. But I cannot see any closing of
the
connection. I guess should be a C# garbage collection thing. It is
supposed
to be closed when the connection is no longer in use, right ? Well, in my
case it doesn't seem to be closed appropriately, at least not in due
time.
Only after a while of waiting (several minutes) can I get back into the
site. Some connections then probably have timed out.

Been struggling with it for a couple of days ow and getting really
frustrated. Is this a Beta bug maybe ? Has anyone else experienced this ?
How can I fix it - or get around it ?

Any clues appreciated!

Bendik



Nov 19 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.