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