Created On:  14 December 2012

Problem:

Customer has an application that uses many indexed files that are opened for input so that the application can read records in each of the files.

This processes OK when only a single instance of the application is running but when multiple instances of the application are running, the performance gets quite a bit worse and file locks begin to be returned to the applications.

No application is updating the files.  How can we improve the performance and get rid of the locking issues that are occurring when multiple instances of the application are running?

Resolution:

Try opening the files using the following statement:

   OPEN INPUT SHARING WITH READ ONLY filename

This tells the file handler to only allow other applications to open the file for read-only so that it does not have to include all of the overhead checking to see if the files have been updated by another application since the last read took place.

This can dramatically increase performance and also gets rid of any locking issues that can occur when multiple processes are sharing the same indexed file.