Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 .NET Inside SQL Server (2005)
 Need help, threads keep failing.

Author  Topic 

cbrownTN
Starting Member

1 Post

Posted - 2010-07-23 : 20:49:57
I have a program that obtains a main connection then launches different threads (up to 12 at a time) that simply query the DB, make a decision based on some parameters within the code and then make an update to a table in the DB. After a particular thread makes the update (or decides not to based on parameters) it closes. New threads are launched and the process repeats itself. The whole thing actually works fine for several hundred (sometimes thousands) of iterations. THEN all of the sudden (at random times) a thread fails to either get the answer back from the DB or times out OR looses its connection. Network not the issue. Then the whole program looses the connection and all threads fail. I cannot understand why these threads can work just fine so many times and then BOOM, Failure. Any help, I have tried using dispose method and close, to make sure threads aren't building up. I cannot identify the problem. Any thoughts?

CSears
Starting Member

39 Posts

Posted - 2010-08-31 : 14:30:58
Have you checked the database to see if there is some reason those threads are held up by another process? You should be able to see all the unique threads and which ones are being blocked and by what process. See if your threads are creating a deadlock with each other.
Go to Top of Page
   

- Advertisement -