Published 'Personal WEB Site' problems

  • Thread starter Bendik Engebretsen
  • Start date
B

Bendik Engebretsen

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
 
G

Guest

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

Bendik Engebretsen

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.ConnectionStrings["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


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

Juan T. Llibre

See : http://beta.asp.net/QUICKSTART/aspnet/doc/management/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 said:
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.ConnectionStrings["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


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 said:
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
 
B

Bendik Engebretsen

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

See : http://beta.asp.net/QUICKSTART/aspnet/doc/management/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 said:
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.ConnectionStrings["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


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 said:
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
 
J

Juan T. Llibre

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.../ConnectionStrings/UsingConnectionStrings.src

try
{
// your Select statement
}


finally
{
connection.Close();
}





Bendik Engebretsen said:
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|Personal.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

See : http://beta.asp.net/QUICKSTART/aspnet/doc/management/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.





Bendik Engebretsen said:
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.ConnectionStrings["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


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 said:
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,228
Members
46,818
Latest member
SapanaCarpetStudio

Latest Threads

Top