Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7822131
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T07:50:18+00:00 2026-06-02T07:50:18+00:00

I’m currently creating a process for our business which takes some data from a

  • 0

I’m currently creating a process for our business which takes some data from a database (A), does some work on the data and then copies it out into another table in another database (B). The amount of data we’re processing in large and we’re expecting this process to take a long time (weeks).

Is a sensible design choice for this kind of task to use WCF? That way I thought I could have some kind of client application/web front-end (that the rest of the business can use) to ‘query’/show the progress of the overall import process. I’d also like to give clients the ability to start/pause/stop the import process through the service.

Is this do-able in WCF? Is this even the right choice? I suppose in some ways this needs to act like a regular Windows Service (I just thought it would be easier to ‘query’ the progress of the import via some methods I could expose via WCF?)

Also, could I run into problems for example if one user tried to start/stop the import process at the same time etc.? Is the singleton pattern the appoach to ensure that everyone is working with that same, single import process?

Any thoughts/ideas are much appreciated.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T07:50:20+00:00Added an answer on June 2, 2026 at 7:50 am

    Edit/Preface: This answer assumes that you want to use WCF only for user interaction with the process rather than for communication of the entire software stack, and that the core work is done by the long-running service itself.

    Yes, this is doable in WCF, and it’s probably the right solution. You’ll have a long-running processor thread that frequently queries/updates some set of interop properties (for instance, it will update the percent done that it is, what item it’s working on, and check for a “pause” flag, etc.). Those properties will in turn be queried/set by the WCF interface methods.

    The singleton pattern is perfect for this – if your threading is setup correctly, the users will interact with some properties that the long-running thread (or threads) check.

    From an extremely high level perspective, the processor class would probably look something like this at the core (this is just a model for how it can be done; don’t make it exactly like this or I will have nightmares):

    // IWcfProcessor is the ServiceContract interface
    // Processor runs as a singleton and does (or has a thread that does) the processing work
    class Processor : IWcfProcessor
    {
        public Processor()
        {
            new Thread(Process).Start();
        }
    
        public void Process()
        {
            while (Run)
            {
                // Do long-running process stuff, update some tables
                PercentDone += 0.1;
            }
        }
    
        public decimal PercentDone { get; set; }
        public bool Run { get; set; }
    
        /// WCF method defined in IWcfProcessor
        public void SetState(bool state)
        {
            Run = state;
        }
    
        /// WCF method defined in IWcfProcessor
        public decimal GetStatus()
        {
            return PercentDone;
        }
    }
    

    You can then hook into the IWcfProcessor touchpoints from a web or application endpoint.

    Also, could I run into problems for example if one user tried to start/stop the import process at the same time etc.?

    Assuming you setup the threading interop correctly, you won’t have problems.

    Is the singleton pattern the appoach to ensure that everyone is working with that same, single import process?

    Yes, this is perfect.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

For some reason, after submitting a string like this Jack’s Spindle from a text
I have a text area in my form which accepts all possible characters from
I am currently running into a problem where an element is coming back from
Does anyone know how can I replace this 2 symbol below from the string
I have some data like this: 1 2 3 4 5 9 2 6
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
I am trying to understand how to use SyndicationItem to display feed which is
I used javascript for loading a picture on my website depending on which small
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.