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 7726311
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T05:10:54+00:00 2026-06-01T05:10:54+00:00

I am writing a console application that will do two tasks. The app will

  • 0

I am writing a console application that will do two tasks.
The app will be run by a Windows scheduler once a day during off-peak hours, when it does run it will do the following:

  • Scan 5-6 folders with several hundred files, update a SQL table with the file names
  • This app will be referenced by two other applications, these applications will utilize a public method to write exceptions to a SQL table. The exceptions would more of business rule exceptions.

There is a possibility that the app will be called by the scheduler to do its assigned task and also by the other applications at the same time. How would I design the app to ensure that there are no conflicts. I am thinking along the lines of multi threading, parallel tasks?

  • 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-01T05:10:55+00:00Added an answer on June 1, 2026 at 5:10 am

    You do not really need to do anything. The OS handles all the parallelism for you in this situation. The task scheduler starts one process. Those other apps that use yours are running in separate processes. You can run all the processing on a single thread and both tasks can still proceed in parallel.

    The only thing you need to be careful about is shared resources. For example, if you’re writing to a hard-coded log file while doing this, one of the tasks will either fail, or will have to wait for the log file to become writable.

    Unless you’re doing something silly, the SQL access should be no problem either; just make sure you run all the queries that pertain to a task in a transaction, leaving the database in a consistent state at the end of the transaction.

    One potential source of problem is the pretend-serializable transactions, as I like to call them. In MSSQL they are called SNAPSHOT transactions. To be absolutely fully safe, make sure you use serializable transactions and be ready to retry the whole thing if the commit fails due to a conflict.

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

Sidebar

Related Questions

I'm writing a console application that will be deployed with an installation of an
I am writing a console application in python that will consist of a handful
I'm writing a console application Windows that creates some objects in the main thread
I'm writing a console application that does a good amount of data retrieval from
Ok guys so a little background... I'm writing a small application that will assign
I am creating a forecasting application that will run simulations for various modes that
I'm writing a small c# console application that needs to interogate Websphere Application Server
So I am writing a C# console application. I have a text file that
I have a java console app that I'm writing, and I want people to
i have my application that sometimes will freeze, without any error in console. I

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.