views:

359

answers:

1

Ok, I was deciding between a thread or BackgroundWorker process and based on the responses from this thread I decided to go with the BackgroundWorker. Here is the thing though, when I started the worker process it stopped half way with a connection timeout error to the database. This is normal when the process is run directly on the DB server (4-5 mins) as I am talking a lot of invoices here. Anyways, I know I can adjust the connection string timeout, but has anyone run into similar issues? What's the average timeout used in these types of scenario?

I was thinking of creating a separate connection with a different timeout specially for this task. This invoice generating task will be ran by one person.

+1  A: 

Are you sure this is related to the Connection Timeout and not the Command Timeout?

The time to connect to the database is irrelevant to how heavy is the query. This might indicate a different problem.

If the query is very slow, you should firstly optimize the query and then set the Command Timeout to the expected runtime of the query.

Vinko Vrsalovic