Check for Shelled Program

K

Kat

Hi All,

I have an application that uses shell to open another database that then
runs in the background while the main application continues. This is
somewhat of an automated overnight process that runs a series of steps and
uses shell for different databases so that it doesn't slow down the main
process.

The problem I am having is when then "main" process errors and stops it
sometimes closes the database entirely or needs to be restarted from scratch.
While I can usually fix whatever caused the problem when I come in for work,
one of the databases that are running from the shell in the main database
might still be running. The problem is that in order for the main process to
figure out where it got to before it errored, it goes through the entire set
of code, thus starting the shell again.

What I would like to know is if it is possible to check to see if a program
is open on the particular computer (this is all run on one pc) and therefore
I can put an If..Then..Else statement in to not run the shell command again.

Just in case I've not explained this particularly well
ex.
Database a and b both have code to step through each step they need to run
on a daily basis so they can be picked up easily should they error and need
to be restarted

Database a runs and does 20 steps
step 21 uses shell to open database b
database b starts running its steps
database a errors on step 23
I sort out database a and restart the code
database b is still running in the background
database a runs through steps 1-20 skiping them because they have run
database a runs step 21 because it is a shell and it can't tell if its done
or not (what I am asking is there a way for it to check here if database b is
currently open)
database a continues with step 22-50 as per normal
there are now 2 database b running at the same time causing conflicts in
database b with the code that determines if steps have run or not.


I hope this makes sense and I thank everyone for any help they can give.

Kat
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top