Both JOBADMIN and the Job Admin DLL default to locking UJP files while they are being read or updated, by writing a lock file into the ACTIVE folder.  The file name of the ACTIVE file is formed as follows (where O is the owner folder name and T is the jobtype folder name):

Owner UJP files: JA_O_owner.ujp

Jobtype UJP files: JA_O_T_jobtype.ujp

Instance UJP files: the instance filename

Users of the Job Admin DLL can improve efficiency by suppressing the creation of lock files when the calling application is aware that no other process will be updating the file and JOBADMIN is unlikely to be in use.  Even when there is a possibility of conflict, the calling application can also explicitly create a lock before a sequence of operations and remove it on completion.

This is done by defining a FAXFACTS.CFG variable JOB_DLL_LOCK_OPTIONS to control which operations use locks.  The value of this variable is a sequence of 0/1 values, where 0 disables the lock and 1 enables it.  The locks are only affected when a user-supplied application calls the DLL.  When JOBADMIN or another CopiaFacts application calls the DLL, the locks are always used, and locks are also applied explicitly in other applications such as JOBXDATA.

Digit 1Controls the locks on the Owner and Jobtype UJP file applied while reading them to create a new instance.  These files are opened in read-only mode and locked against writing.
Digit 2Controls the locks on the Owner file applied while creating or cloning a new job type UJP.  This protects the folder names under the owner folder.
Digit 3Controls the locks on an Instance UJP while performing the Broadcast Document functions (some of which update the file).
Digit 4Controls the locks on an Instance UJP while performing the Broadcast List functions (some of which update the file).
Digit 5Controls the locks on an Instance UJP while performing the Direct UJP Access functions (some of which update the file).
Digit 6Controls the locks on an Instance UJP while performing various job actions which may affect all job items, such as change priority, resubmit
Digit 7Controls the locks on an Instance UJP while updating Job IVR settings

If any of the above values are set to zero, the user-supplied application must either ensure that no CopiaFacts application can access the protected file(s) while the user-supplied application is doing so, or must explicitly set a lock before its operations and release it afterwards, using the CreateActiveUJPLock and ReleaseActiveUJPLock functions.

Function Name: CreateActiveUJPLock

Inputs:  Parm1 = UJP pathname
         Parm2 = LockName
         Parm3 = MinutesLife

Outputs: Parm2 = LockSignature

Returns:  1 = success
          0 = error

If this function cannot obtain a lock after the number of attempts specified by $lock_tries, at 50ms intervals, it returns a 'false' value (0).  If the MinutesLife value is 0 or negative the value from $active_life will be used.  The LockName text is written into the ACTIVE file and can be used to identify the application in the case of a failed or omitted release.

The LockSignature is a string containing an integer value which must be passed to the release function.

The function succeeds and updates the lock file if there is already a file older than the MinutesLife value.

 

Function Name: ReleaseActiveUJPLock

Inputs:  Parm1 = UJP pathname
         Parm2 = LockSignature

Returns:  1 = success
          0 = error

This function will return a false value (0) if there is no lock file for the UJP in the ACTIVE folder, or if its LockSignature does not match, or if the file cannot be deleted.

Both functions derive the ACTIVE filename from the passed pathname.