Windows service thread not updating database until complete

Posted by dfarney on Stack Overflow See other posts from Stack Overflow or by dfarney
Published on 2011-02-10T15:20:57Z Indexed on 2011/02/10 15:25 UTC
Read the original article Hit count: 162

I have a windows service with a FileSystemWatcher. When a new file is dropped in my folder a new thread is created, started, and I begin processing the file. Throughout this process I am making updates to the database (Linq to SQL) to keep track of the file's processing progress.

Problem is none of my database updates are reflected throughout the process, just an update after everything has been completed. Any ideas?

Note: when doing dev/testing my code was in an aspx page and worked great, but when I put it in a windows service I no longer get the progress updates.

Thanks!

© Stack Overflow or respective owner

Related posts about multithreading

Related posts about linq-to-sql