Writing Multi-User Applications

Modern applications, both on the PC or those running on servers, have requirements to cater for multiple instances of the application running at the same time - for example, in a multi-user environment, each user running a session simultaneously with other users.

Many COBOL applications are traditionally single user programs that run in single sessions, each independent of each other. These applications are not coded to run in a multi-user environment. If you try to run several instances of the same application simultaneously, you can end up with file-locking issues, and in addition, memory isolation can break down when the same resource set is being used by multiple users.

You could rewrite the code, but that would almost certainly require significant and costly code changes.

Visual COBOL solves this with a construct called a Run Unit that can co-exist in the same process. A Run Unit is a collection of one or more programs that share the same address space, lock tables, and OpenESQL connections. When using the run-time system services type RunUnit you can create multiple Run Units in the same process, with all individual Run Units being isolated from each other.

A COBOL program in one Run Unit does not normally access the memory of a program in another Run Unit. There is isolation between them. Also, file locks are held for each Run Unit - if a program in one Run Unit holds a file lock, it is not accessible to a file-handling program in another Run Unit in the same process.

For complete details on using and coding multiple run units for procedural COBOL, see multiple user COBOL application in Java.