.NET server applications, such as ASP.NET and .NET remoting, 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 .NET, server applications are executed and controlled by application domains. Each application domain can execute multiple instances of an application at the same time.
By default, when a procedural COBOL application runs in an application domain, 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:
Note that you leave the existing procedural COBOL 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.