>>>> But Wondering why would shell script be locked if someone is running it. Isn't it same like multiple jobs calling same program concurrently without lock? <<<<
In IBM i QSYS file system, a *PGM object is distinct from a *FILE object but this is not so in IFS that comes from UNIX/PC world in which every thing is just a file - no distinction here.
But in any OS, file locking control is a crucial feature for managing access in multi-user environment. For example in IBM i QSYS file system, you can use ALCOBJ command to specify different manners of object locking for your job. But I'm not as familiar with IFS environment in this respect. If you happen to know any equivalent UNIX shell command to ALCOBJ, you may try it from your Java program. I hope such a control should be available in UNIX/IBM i Qshell. Or you might want to ask a new question on whether an equivalent of ALCOBJ for IFS file is available for use from Qshell.
Original Message:
Sent: Mon May 27, 2024 02:41 AM
From: Sarfaraj Pirjade
Subject: concurrent call of listWebServicesServers.sh creating contention
Thank you very much Satid for your response. I just tried the IBMi SQL service. It gives me return if someone is locking it. So I can handle it programmatically.
But Wondering why would shell script be locked if someone is running it. Isn't it same like multiple jobs calling same program concurrently without lock?
Is this a limitation or normal to have such lock. Thank you
------------------------------
Sarfaraj Pirjade
Original Message:
Sent: Fri May 24, 2024 09:26 AM
From: Satid S
Subject: concurrent call of listWebServicesServers.sh creating contention
Dear Sarfaraj
How about checking if the file /QIBM/ProdData/OS/WebServices/bin/listWebServicesServers.sh is being used or not before running it? I figure you can use IBM i service QSYS2.IFS_OBJECT_LOCK_INFO ( https://www.ibm.com/docs/en/i/7.4?topic=services-ifs-object-lock-info-table-function ) to do this check. (This service is available as of IBM i 7.3 with a certain level of group PTF.) If it returns a null value (no job is using it), then you run the shell command. If it does not return a null, then do DLYJOB for 1 or 2 seconds and do the check again.
------------------------------
Satid S
Original Message:
Sent: Fri May 24, 2024 07:14 AM
From: Sarfaraj Pirjade
Subject: concurrent call of listWebServicesServers.sh creating contention
I am trying to use shell command listWebServicesServers.sh to get status of IWS servers on IBMi. There are 2 IWS servers on our IBMi.
We have executing 2 separate jobs to monitor status of 2 IWS servers. We faced a scenario when both these 2 jobs try to execute shell command
listWebServicesServers.sh approximately at same time , sometime 1 job and sometimes both the jobs get hanged in TIMW status.
In our job, we call shell command listWebServicesServers.sh using QCMDEXC. The users of these 2 jobs are same and have required authority to run this command.
At times, when these command are executed at different times in both these jobs, we dont get this contetion issue. We tried to hold one job and monitored other job. In that case there is no contention issue.
So we think hand issue is coming when the same shell command is executed as same time by both the jobs.
Did anyone face this issue. Any issue with underlying java program ?
------------------------------
Sarfaraj Pirjade
------------------------------