Quantcast
Channel: Forum SQL Server Database Engine
Viewing all articles
Browse latest Browse all 15694

Problem with Multi Threads and Sql Server - TimeOut

$
0
0
I've created a console application that purge some log table (~11). and my application use Parallel.foreach to loop and create some threads.
The flow is something like this:

- Loop creating threads
- Inside one thread
       1 Purge table (~200000 registers)
       2 Save log
       3 If have more registers to purge go back to step 1 (recursive)
- Save general log

All tables have to purge ~3000000 registers.

The problem is in some cases we got a timeout but not in all tables.
I tested without creating threads and it works.
Whats the problem with threads and sql server?

The LDF file is locking something?
The database cant do this purge with threads?!

Thanks

Viewing all articles
Browse latest Browse all 15694

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>