Created On:  18 January 2013

Problem:

Customer is converting a Net Express native application to Visual COBOL managed .NET code.

Under Net Express the application uses OpenESQL to connect to SQL Server database using ODBC. (SQL(DBMAN=ODBC))

It is a multithreaded application so the compiler directive SQL(THREAD=ISOLATE) was being used so that database connections would not be shared between threads.

Under Visual COBOL the managed .NET application is using SQL(DBMAN=ADO) and the customer reports that connections to SQL Server are being shared between threads even though they specify SQL(THREAD=ISOLATE).

The question would be is the THREAD=ISOLATE directive supported for use with ADO or is it onlu supported for ADO?

Resolution:

The SQL(THREAD=ISOLATE) directive applies only to ODBC. For managed code, both JDBC and ADO, the SQL runtime isolates SQL runtime instances associated with service requests by using run units rather than threads, in line with recommendations in the COBOL documentation.

See the topic Programming->Managed COBOL Programming->Multiple User COBOL Applications in .NET for more details. Each service request handled under an application server (such as ASP.NET or Tomcat) should load the COBOL program that will service the request into a new run unit before calling it to process the service request. When EXEC SQL statements are executed the SQL runtime will ensure that all SQL statements executed within a run unit are processed by a SQL runtime instance that has been associated with the run unit, and that SQL resources used by each run unit (and its associated SQL runtime instance.