Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C# WCF
Hello,
I am new to WCF. I have a batch. In one batch I have many records. First I am calling the service and storing records information in my DB and giving Db storing status to client.
 
Once I return the status, I need to close wcf connection. After that I need to process those records asynchronously. Client doesn't need to wait until I process all the records.
 
Thanks in advance.
 
Thanks and Regards
 
Vishnu
Posted 17-Feb-13 19:49pm
Edited 18-Feb-13 9:16am
v2

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

I would not recommend you to close the connection while there is still data being processed...
 
Creating a thread on the client side who waits in the background until all the records are processed at the server side and then invokes a message (e.g. a status bar label) to show the user that the processing was successful is IMO the better way to handle this.
 
You have certain main advantages when solving this with my suggested method:
- The user can continue working
- The user stays up-to-date if the processing was successfull or not (remember that there is always a possibility to fail when you are working with WCF and / or databases).
 
The only thing you might need to add is a logic which does not allow the user to close your app while the server is still processing data (Or display a warning message before closing the client app).
 
I just had the great idea of writing an article about this topic. Thank you!
If you wish to I can let you know when I am done with it Smile | :) .
 
cheers,
Marco Bertschi
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 310
1 Sergey Alexandrovich Kryukov 176
2 PhilLenoir 164
3 Richard MacCutchan 160
4 Sharmanuj 146
0 Sergey Alexandrovich Kryukov 6,081
1 OriginalGriff 5,115
2 CPallini 2,473
3 Richard MacCutchan 1,597
4 Abhinav S 1,505


Advertise | Privacy | Mobile
Web04 | 2.8.140814.1 | Last Updated 18 Feb 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100