Yes, that behavior was actually caused a bug in previous versions that caused detached jobs to run always asynchronous mode even when they must run in synchronous mode. JobRun by design causes the job to run in synchronous mode before returning control to the caller job. If you want to spawn a separate job and don't want to wait for that job use a slightly different method. Instead of JobRun( job_name ) use Dim(command, string, "24x7.exe /JOB ") Dim( pid, number ) Concat( command, job_name, command ) Run( command, "", pid ) In case if job name contains spaces enclose job name in double quotes or use job id in the Run command instead of a job name. If job name is non-unique always use job id to refer to this job. : I have a job that watches a directory for changes. : When it sees a file in the directory it opens the : file and creates a dynamic 24x7 jal job based on : the data in the file. It then starts that dynamic : job and goes back to waiting for changes in the : directory. The dynamic jobs are created as detached : jobs so that they will not interfere with the running : of the watch job or any other jobs in the job database. : Since upgrading o the 3.4.21 patch the watch job now : waits for the dynamic job to complete before it goes : back to watching the directory. This should not be : happening since the job it created is detached. : Here is a snippet of the code that creates the job: jobcreate(job_num) : JobModify( job_num, "name", job_name ) : JobModify( job_num, "script", script_line ) : JobModify( job_num, "job_type", "S" ) : jobmodify( job_num, "detached", "Y") : jobmodify( job_num, "schedule_type", "O") : jobmodify( job_num, "queue", "JobProcessor") : JobEnable( job_num, true ) : jobrun( job_name ) : The variable job_name is the name I want the job to : have, and the variable script_line is the text of : the jal script I want to run. : Any help would be good, : Jamie
|