[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

C# - Looking for some code to wait for a for an external process

Posted on 2013-01-19
4
Medium Priority
?
297 Views
Last Modified: 2013-01-22
I'm developing an app that requests data from an external Oracle DB via a WAN connection. The Oracle DB is SLOW to return the data. Depending on the data being requested, the response time varies from 3 minutes to 20 minutes. Here's an algorithm I'm planning on developing. I need suggestions with Step 3

Step 1 - Delete the local copy of the previous Oracle export file (tab-delimited).
Step 2 - Send request to Oracle server for new file (using BAT/CMD file combo).
Step 3 - Wait for 60 seconds.
Step 4 - Check for the presence of the new export file.
Step 5 - Is the file there? Advance to Step 6. If not, return to step 3.
Step 6 - Import the file.
0
Comment
Question by:jdana
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 23

Assisted Solution

by:Michael Fowler
Michael Fowler earned 520 total points
ID: 38797837
The following will cause the application to wait for 60 seconds

System.Threading.Thread.Sleep(60000);

Michael
0
 
LVL 13

Assisted Solution

by:Naman Goel
Naman Goel earned 520 total points
ID: 38797967
Yes, Thread.Sleep will stop the executing thread for given amount of time. However if you want remain responsive (UI doesn't freeze) you might consider timers.
0
 
LVL 83

Accepted Solution

by:
CodeCruiser earned 520 total points
ID: 38800710
>Step 4 - Check for the presence of the new export file.

Given that you are waiting for a file to be created, instead of using timers or making threads sleep, you can use the FileSystemWatcher object to monitor the folder and when the file arrives, your code will be triggered automatically so you can import the file


http://www.codeproject.com/Articles/3192/Watching-Folder-Activity-in-VB-NET

http://www.blackwasp.co.uk/FileSystemWatcher.aspx
0
 

Author Closing Comment

by:jdana
ID: 38805850
Thanks to all three of you for some excellent responses.
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …

650 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question