Hello, I have question regarding scheduling, and how to set the properties on jobs. I am currently using 1.6.3. I played with the v2.0 beta version a little, and I believe problem will still be an issue.

Senario: I have a series of jobs that need to run on the hour, and on every half hour from 9 AM to 8 PM (i.e. 9, 9:30, 10, 10:30,...etc.) The job runs anywhere from 3-10 minutes depending on what it finds for data... I reviewed your example for running a job from 9 - 5, and I have written a script to handle the job times, but I am confused on what the job properties should be.....

What is the behavior of the job if it is marked "asynchronous"? Will the job be invoked every minute if I set the time interval to 1 minute? Remember the job itself will run 3-10 minutes, my concern is that an "asyncronous" job will be started at "31", "32", "33" minutes..etc. that will interfere while the original job at "30" minutes is running. I need to have the process start at the specific times, so I need to have the 1 minute interval. I can't really set the job to "synchronous" because I have other jobs that will need to be started if the hour/half-hour job is running long (I have other jobs that start at 5 past the hour, also having strict time requirements). Being unable to set the job as "synchronous" eliminates the possibility of using the "jobmod" function.

Any comments / suggestions?

As an idea to get around this.. Is it possible to have function that will wait for a specific time? Something like WaitTime(timetowaitfor) where "timetowaitfor" is a "time" data type? In the new version, it appears that I can specify/create my own functions. Is this a case where this user defined functions would help?

Thanks, Bob

Wed Feb 16, 2000 3:26 pm

SysOpSite Admin

Joined: 26 Nov 2006Posts: 6608

Re: Time scheduling

"asynchronous" means that job runs in the background and other jobs will not wait for it to complete. If such job takes 10 minutes to run and the time interval (perhaps you set up it as an "all day" schedule) is 1 minute then you may end up with multiple instances of this job running simultaneously.

There are multiple workarounds for this situation. Just one of them: Use a global boolean variable in your job, let's call it GLOBAL.RUNNING. On start, the job should check the GLOBAL.RUNNING variable and if it is set to TRUE simply exit becuase another instance is already running, otherwise set it to TRUE and continue running. At the of the run if should reset the variable to FALSE. This way even an asynchronous job can be guaranteed to run just one at a time.

As for the "WaitTime(timetowaitfor)", you can make an user-defined statement like the following:

: Hello, : I have question regarding scheduling, and how to set the properties on jobs. : I am currently using 1.6.3. I played with the v2.0 beta version a little, : and I believe problem will still be an issue.

: Senario: I have a series of jobs that need to run on the hour, and on every : half hour from 9 AM to 8 PM (i.e. 9, 9:30, 10, 10:30,...etc.) : The job runs anywhere from 3-10 minutes depending on what it finds for : data... : I reviewed your example for running a job from 9 - 5, and I have written a : script to handle the job times, but I am confused on what the job : properties should be.....

: What is the behavior of the job if it is marked "asynchronous"? : Will the job be invoked every minute if I set the time interval to 1 : minute? Remember the job itself will run 3-10 minutes, my concern is that : an "asyncronous" job will be started at "31", : "32", "33" minutes..etc. that will interfere while the : original job at "30" minutes is running. I need to have the : process start at the specific times, so I need to have the 1 minute : interval. I can't really set the job to "synchronous" because I : have other jobs that will need to be : started if the hour/half-hour job is running long (I have other jobs that : start at 5 past the hour, also having strict time requirements). Being : unable to set the job as "synchronous" eliminates the : possibility of using the "jobmod" function.

: Any comments / suggestions?

: As an idea to get around this.. Is it possible to have function that will : wait for a specific time? Something like WaitTime(timetowaitfor) where : "timetowaitfor" is a "time" data type? In the new : version, it appears that I can specify/create my own functions. Is this a : case where this user defined functions would help?