Click here to Skip to main content
12,954,631 members (56,698 online)
Rate this:
Please Sign up or sign in to vote.
See more:
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
Updated 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 :-).

Marco Bertschi

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

    Print Answers RSS
Top Experts
Last 24hrsThis month
OriginalGriff 6,539
CHill60 3,490
Maciej Los 3,153
ppolymorphe 2,030
Jochen Arndt 1,975

Advertise | Privacy | Mobile
Web01 | 2.8.170525.1 | Last Updated 18 Feb 2013
Copyright © CodeProject, 1999-2017
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