Click here to Skip to main content
11,578,524 members (60,615 online)
Rate this: bad
Please Sign up or sign in to vote.
See more: C# WCF
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

Posted 17-Feb-13 19:49pm
Edited 18-Feb-13 9:16am

1 solution

Rate this: bad
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 | :) .

Marco Bertschi

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

  Print Answers RSS
0 Peter Leow 175
1 Richard MacCutchan 165
2 OriginalGriff 129
3 Afzaal Ahmad Zeeshan 90
4 Frankie-C 75
0 OriginalGriff 904
1 Sergey Alexandrovich Kryukov 715
2 Abhinav S 573
3 F-ES Sitecore 420
4 Suvendu Shekhar Giri 393

Advertise | Privacy | Mobile
Web03 | 2.8.150603.1 | Last Updated 18 Feb 2013
Copyright © CodeProject, 1999-2015
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