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