Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2177
  • Last Modified:

Multithreading/Database Polling in Windows Service

Poll database table, looking for items to process
Queuing items for processing
Process files on disk (the database table being polled describes the files being processed (file path, processing status))
Record processing results to database

The processing time for each item is assumed to take a long time (hours), so processing should take place on its own thread and multiple items should be processed concurrently (though probably not all items in the queue if the queue has a lot of items).

I'm not an expert
0
afifosh
Asked:
afifosh
  • 3
  • 2
1 Solution
 
Julian HansenCommented:
What's the question?
0
 
afifoshAuthor Commented:
the procces who i can do this ? using c# and thread ..
u can take a look for this code

http://www.codeproject.com/Articles/16615/How-to-Create-a-Simple-Polling-Service
 

this my first time on windows app and i want to write a service can read and process record from table

and after finish it i repeat the job again using c# ?

and if the code is that why i need tell me where i will insert my  sql connection and add begin transaction
code...
0
 
Julian HansenCommented:
Ok so what you are are asking is for someone to provide the code that does the above - is that correct?

It seems the basics are in the CodeProject article - what is missing that you need?
0
 
afifoshAuthor Commented:
what i need is i have a table on database where i store on it  all task added by user from web applicaitonn

so my application should be run as windows service and do the task
the task is

some sql query
select the record update status of record to begin processing
insert data on new table
select some record and post to an url
http://127.0.0.1:8800/?PhoneNumber=xxxxxxxx&Text=abc+def+ghi

use transaction on query if the sql query didn\t committed rollback it to original state
to re process it again..

when i finish and my all my query and post url .. update the status to DONE
to prevent read it again ..

than i want to repeat this jobs when he finish


1- run windows service
2- do a job
3- wait sleep 30 second
4- repeat the same job

because the job it will select record from the database

and my table all time i have new record !!
0
 
afifoshAuthor Commented:
still now i didn't get any solution maybe no one understand what i mean with my question and still now i don't need to solve it because is too late
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now