Java server applications, such as servlet containers, typically have multiple users, each user running a session simultaneously with other users, whereas COBOL applications traditionally run single sessions each independent of each other. In Java, server applications are executed in a container. Each container can execute multiple instances of an application at the same time.
By default, when a procedural COBOL application runs in container, it is executed in the default COBOL run unit and it uses threads that share the same address space, by definition. If the application is executed several times simultaneously, that same run unit is used and consequently the same data is shared between all executions, which can cause problems.
In a multiple user environment, the COBOL application must use multiple run units, with each instance of the application running in its own run unit. To do this, you need to:
Existing procedural COBOL is left unchanged:
Any COBOL program or CLASS with instance data/methods can be used with multiple run units providing you do not compile with the REENTRANT or ILSTATIC directives.