Skip to main content

Problem:

Using Informix File handler for Informix files instead of the Micro Focus file handler.

Basically, the number of open files increases to a stage where some processes hangs and when it reaches the open file limit, it crashes.  Common files are not closing, while all the other files are closed, which causes the number of open files to increase.

eg:

1. Program 1 opens files A, B, C and D

2. Then Program 1 calls Program 2 which open files X, Y, A and B.

3. Program 2 finishes it process, close files X, Y,  A and B and exit program.

4. Program 1 continues it's process, at this moment Files A and B are opened twice in the system.

5. When this happens several times, the number of files opened by a process exceed the limit and the program crashes with Informix error 24.

Resolution:

Try the following tunable:

multi_close_limit

Syntax:

               set multi_close_limit=integer

Value:

integer     is a value in the range 0 - 1500, representing the number of logical closes after which a                 file is physically closed.

Every time a file is opened, the run-time system calls the operating system to open it - a physical open.  When a file that has been opened more than once in the same process (without corresponding closes) is closed, in order that all locks are preserved, the run-time system closes the file (logical close) but does not call the operating system to close it.  The run-time system only calls the operating system to physically close the file when a corresponding close has been done for each of the opens.  This is the default behavior.

When set to a non-zero value, the run-time system forces a physical operating system close on a file which has been opened more than once within the same process if more than integer closes have occurred.  The run-time system does a physical close for each of the integer logical closes, and then re-applies all outstanding locks on that file.

You should use this tunable with care as, due to the way in which the operating system does a physical close, all locks against all opens on a file are lost until the run-time system has time to reinstate them.  We recommend that where possible, any multiple opens are nested so that all are closed prior to multiple re-opens.  If you do need to keep a file open for a significant amount of time while other programs and/or threads open and close that file you need to use this tunable.

Old KB# 7230

#netexpress
#AcuCobol
#ServerExpress
#RMCOBOL
#COBOL