tjbyfield
25th July 2002, 16:11
We run a cron job every 5 mins to transfer data from a non baan application with production details (quantity and lot serial no) via oracle table. When processed successfully the records are deleted (it is treated like a processing push/pop stack)

The cron job initiates ba6.1 for a 3gl session that loads a dll to process the tranasctions in sfc/ilc/ltc. This all works well 24x7 and the loose coupling allows baan to be closed for short periods without stopping production operations and provides automatic processing of production recording transaction.

However, from time to time when the max users is reached the ba6.1 cannot run.

We need to know when it can not start so that we can shed non critical and/or non active users so the the cron job can get a licence. Unfortunately, ba6.1 does not return a non zero return code that would allow the script to alert us (via email and/or printer).

(A) IS THERE A WAY WE CAN GET b6.1 TELL US IT COULD NOT GET A LICENCE (other than the ba6.1 log)

An in-eligant solution would be for the 3gl session to create a file. In the cron script we could check that it was created - then if not created we would know that ba6.1 could not start the session.

A much better solution would be to keep the dll alive permenently and get it to spring into action whenever a record was written to the oracle table.

(B) IS THERE A WAY OF GETTING THE DLL TO SLEEP AND THEN BEING INITIATED WHEN RECORDS ARRIVE OR PERIODICALLY CHECKING FOR RECORDS (without a process intensive loop)

We have baanIV4c4 with 6.1 porting set on IBM AIX oracle 8.0.5

I will appreciate your help

Terry

garfield ruhr
30th July 2002, 18:31
Hi,

this could be a job of the jobdaemon (ttaad5206m000). If you use the jobdaemon then the scheduling is done by Baan. The bshell (and so the licence) is taken while the jobdaemon is started. Afterwards all jobs running under control of the jobdaemon are running in the same bshell.

The jobdaemon has some problems if it runs for a very long time with lots of different jobs. But if you want only your be started in the daemon then it would be the solution for me.

The startup of the jobdaemon is in an example in $BSE/etc/rc.start_jobdaemon and must be maintained like the rc.start_job script.

Bye,

Garfield :)

tjbyfield
31st July 2002, 02:36
Thank you for your reply:

We initially ran the session from the job daemon but from time to time had problems with the jd hanging. (We make extensive use of the job daemon) Running this and a couple of other programs fron cron gives us worthwhile improvement in operations. The only problem we have had is the occassional licence problem.

We have recently purchased extra licences and have also purchased 'closeidle'. However, we would like to foolproof the licence unavailable problem. (Unless we purchase a large no of spare licences we would still have a licence problem sometimes)

We have allocated 1 licence exclusively for BA but we sometimes have more than one running. Whilst we could allocate more BA licences but that would not necessesarily make the best use of the licences.

Terry:cool:

NPRao
31st July 2002, 03:07
Hi Terry,

You might try to explore using shell scripts in the cron which activate the BaaN jobs -



#bshell6.2 -server ttaad5203m000 2>${BSE_LOG}/rc.startjoberr &

ba6.2 -- -nodebug ttaad5203m000 2>${BSE_LOG}/lmsjob_${BSH_JOB}.${ZDATE} &

# Use ba or bshell depending on your BaaN Version

wait

#Parse the $BSH_JOBOK file to test the job status.
if [[ -a $BSH_JOBOK ]]; then
STATUS=`/bin/grep 'jobstat:' $BSH_JOBOK`
if [[ $STATUS = 'jobstat:OK' ]]; then
exit 0
else
# maybe sleep or pause for few mintues and invoke the ba or bshell command again.
#bshell6.2 -server ttaad5203m000 2>${BSE_LOG}/rc.startjoberr &
ba6.2 -- -nodebug ttaad5203m000 2>${BSE_LOG}/myjob_${BSH_JOB}.${ZDATE} &

exit 1
fi
else
exit 2
fi



You can put the bshell/ba commands in a function and call the function at intervals.

But I am not sure whats the return values if the licence error message is flashed so that you can differentiate the return values between runtime errors and licence errors.

tjbyfield
31st July 2002, 07:57
:) Thankyou NPRao No wonder why they made you a guru

NPRao
3rd August 2002, 05:38
Hi Terry,

I wonder if you tried to use the timeout mechanisms on your BaaN installation.

With these settings you might be able to logoff/kill inactive users and then you can get the licences free to that your job process can be executed.

Here is the more information, which I accumulated from BaaN Support site etc.

Djie-En
6th August 2002, 10:22
Hi,

If your clients are running by GUI and your JOBS only by ba6.1, you can solve your problem by relicensing your system.
If you have for example 10 licensies (Only 10 GUI licences) of which one needed for a batchjob, you should have a license for 1 ASCII and 9 GUI users.
A GUI user will not be able to use the ASCII licence, but a ASCII user will be able to use the GUI licence, if the ASCII licence is already in use.
So we've solved our problem with that.

GN

tjbyfield
6th August 2002, 11:13
Hi Djie-En

Thank you for your reply. We have allocated one ba licence for the job daemon but I like your idea. I wasn't counting the job daemon. We will increase the number of ba licences to cover the the j/d and 2 ba run from cron.

Since posting we have improved the cron initiated scripts to be able to tell when a licence is not available.

Regards

Terry