Click here to Skip to main content
15,907,497 members
Home / Discussions / C#
   

C#

 
GeneralRe: C# Equivalent of VB6 Function? Pin
Eddy Vluggen16-Nov-18 10:11
professionalEddy Vluggen16-Nov-18 10:11 
QuestionConverting nested object to JSON Not nested objects Pin
Member 1338930215-Nov-18 23:09
Member 1338930215-Nov-18 23:09 
AnswerRe: Converting nested object to JSON Not nested objects Pin
Richard Deeming16-Nov-18 1:02
mveRichard Deeming16-Nov-18 1:02 
AnswerRe: Converting nested object to JSON Not nested objects Pin
Nathan Minier16-Nov-18 1:23
professionalNathan Minier16-Nov-18 1:23 
Questionupdate option not functioning in gridview Pin
Stephanie Joanne15-Nov-18 16:38
Stephanie Joanne15-Nov-18 16:38 
QuestionRe: update option not functioning in gridview Pin
Richard MacCutchan15-Nov-18 21:44
mveRichard MacCutchan15-Nov-18 21:44 
SuggestionRe: update option not functioning in gridview Pin
Richard Deeming16-Nov-18 0:59
mveRichard Deeming16-Nov-18 0:59 
QuestionIntegrating multi-threading into this application. Are there any issues you can see arising from this? Pin
Goalie3515-Nov-18 10:50
Goalie3515-Nov-18 10:50 
Hello.

Sorry in advance for the long post.

We currently have a c# console application that pulls medical claims from our client via a web service. Our application doesn't handle multi-threading at the moment. Unfortunately, we've recently been told by the client that we're going to start receiving millions of claims all at once (as opposed to the typical few thousand per day) & after doing the math, we've determined it would take weeks for this application to process that many claims, so we thought introducing multi-threading into the application would help. However, this raised a question of a potential issue: if it's multi-threaded, how do we ensure no claims get lost in the mix and never pulled?

Our current process is as follows:

1) We pull an initial list of all claim id's from the client. This is a one-time pull and we store the list.
2) We then read off the next claim from that list & call their web service for the details of that claim. We do this one claim at a time, until we've finished pulling the details of every claim from that list.
3) Before pulling each claim, we store the value of the claim id we're trying to process into a "Last Claim ID Processed" field in our db table, in case there's ever a system crash and we need to pick up later with the claim id where we left off with. This way, our application just basically says "ok, I see there was a failure last time we ran. Lets start off with claim id#12345 rather than starting from the very beginning of the list"
4) Finally, we store that claim info in our database and move onto the next claim.
The bulk of our time is at step #2, where we process each claim, so this is the piece we want to split into multi-threading. Where we can split this process into about 10 threads and each one can asynchronously read the next claim id from the claim list that we pulled in step #1. Theoretically, that should make our application process claims 10 times faster than it currently is. But my problem is how would each thread know which other claims are already in the midst of being processed?

So again, my concern is, how do we ensure no claims get lost in the mix? For example, I'm concerned about the following scenario:

1) Thread #1 reads from the claim list & pulls the next claim. Claim id 10001. Before processing, it stores the value of this claim id into our "Last Claim ID Processed" field in our import summary table, to let us know it's the last claim processed in case of a crash (step #3 above)
2) Thread #2 reads from the list & pulls claim id 10002 & repeats the same process
3) Thread #3 reads from the list & pulls claim id 10003 & repeats the same process
4) Thread #1 finishes processing claim id 10001 & starts pulling claim id 10004. And again, stores that claim id value into the import summary table.
5) Thread #3 crashes and never finishes pulling claim id 10003...

In the above scenario, we have a big problem! Claim 10003 crashes but we'll never know because thread #1 has already overwritten the "Last Claim ID processed" field with 10004.

If you've stuck with me this long, I thank you (again, sorry for the long post). But I guess I'm just looking for a little advice on the best way to handle this new multi-threading process we want to integrate. I need to be VERY careful that no claims end up lost in the mix.

Thanks in advance for any advice you can provide!
AnswerRe: Integrating multi-threading into this application. Are there any issues you can see arising from this? Pin
Luc Pattyn15-Nov-18 11:12
sitebuilderLuc Pattyn15-Nov-18 11:12 
QuestionDetect Network / VPN Connection Part 2 Pin
Kevin Marois15-Nov-18 6:46
professionalKevin Marois15-Nov-18 6:46 
AnswerRe: Detect Network / VPN Connection Part 2 Pin
Richard MacCutchan15-Nov-18 10:14
mveRichard MacCutchan15-Nov-18 10:14 
GeneralRe: Detect Network / VPN Connection Part 2 Pin
Kevin Marois15-Nov-18 10:21
professionalKevin Marois15-Nov-18 10:21 
GeneralRe: Detect Network / VPN Connection Part 2 Pin
Richard MacCutchan15-Nov-18 10:27
mveRichard MacCutchan15-Nov-18 10:27 
GeneralRe: Detect Network / VPN Connection Part 2 Pin
Kevin Marois15-Nov-18 10:42
professionalKevin Marois15-Nov-18 10:42 
GeneralRe: Detect Network / VPN Connection Part 2 Pin
Richard MacCutchan15-Nov-18 10:54
mveRichard MacCutchan15-Nov-18 10:54 
GeneralRe: Detect Network / VPN Connection Part 2 Pin
Kevin Marois15-Nov-18 11:07
professionalKevin Marois15-Nov-18 11:07 
AnswerRe: Detect Network / VPN Connection Part 2 Pin
Nitin S28-Dec-18 1:34
professionalNitin S28-Dec-18 1:34 
QuestionHow to copy also subfolders and their files from an certain folder? Pin
Member 1405587915-Nov-18 4:24
Member 1405587915-Nov-18 4:24 
QuestionRe: How to copy also subfolders and their files from an certain folder? Pin
Richard MacCutchan15-Nov-18 6:04
mveRichard MacCutchan15-Nov-18 6:04 
AnswerRe: How to copy also subfolders and their files from an certain folder? Pin
Luc Pattyn15-Nov-18 8:01
sitebuilderLuc Pattyn15-Nov-18 8:01 
QuestionParsing JSon Pin
pkfox15-Nov-18 3:57
professionalpkfox15-Nov-18 3:57 
AnswerRe: Parsing JSon Pin
OriginalGriff15-Nov-18 4:13
mveOriginalGriff15-Nov-18 4:13 
GeneralRe: Parsing JSon Pin
pkfox15-Nov-18 4:22
professionalpkfox15-Nov-18 4:22 
GeneralRe: Parsing JSon Pin
pkfox15-Nov-18 5:10
professionalpkfox15-Nov-18 5:10 
GeneralRe: Parsing JSon Pin
OriginalGriff15-Nov-18 5:27
mveOriginalGriff15-Nov-18 5:27 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.