views:

39

answers:

2

i am reading an RSS feed from a third party and then import data into a database.

Occasionally this process times out.

{"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."}

At the moment i have the following

1) A button on asp.net page 2) Downloads the rss 3) Queried using linq to get the data i want 4) Inserted into database.

What are good practise to minimise time outs. I was think calling an ashx on button click might help. Really appreciate suggestions. This will be on shared hosting.

thanks

+2  A: 

It is your database insert that times out. This could happen if you have many connections to the same server. Are you sure you are closing your connections when you are done with them?

You can also try to increase the connection pool size. Please read this article: http://www.15seconds.com/Issue/040830.htm

Espo
Agreed. SqlConnection needs to be closed as soon as possible.
Lex Li
+1  A: 

It would be better if you could make the RSS call and DB insert from a new background thread. Use a regular page or .ashx or whatever to queue a request to the background thread.

If you keep it in a foreground thread, use async I/O whenever possible to avoid draining the ASP.NET worker thread pool.

And, of course, be sure to close/release/Dispose your all IDisposable objects.

RickNZ
cool, thanks for the tips.
frosty