?
Solved

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

Posted on 2013-01-19
4
Medium Priority
?
293 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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses

762 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