Sometimes your application may experience run-time errors such as "error while reading a file" during DbSkip() or DbSeek() operations. These errors often occur in the following scenarios:
  • large number of concurrent users (>= 15)
  • large index expressions
  • large index files (> 500Mb)
In these scenarios, the aforementioned errors often are due to a machine not being able to acquire an index lock in a suitable timeframe. When skipping or seeking, an index lock must be performed which due to the complexity of the index and the large number of users competing for a lock at the same time, may take longer than the configured timeframe.

Steps to take for reducing concurrency in index operations​

  1. Enable extended locking, if availalble in the index engine you're using, for example, use LOCKING_EXTENDED with the CDXDBE
  2. Increase the lock retry timeout used by the index engine, for example, first triple the current value used for the CDXDBE_LOCKRETRY setting and see if this changes anything. If it does, try going back to the doubled value and see if this still produces consistent results.
    Note: A value of 1,000,000 should be used as a default value for CDXDBE_LOCKRETRY for CDXDBE, irrespective of the problems discussed here!
  3. If your index engine supports multiple tags per index file, try splitting your index so that only a single tag is used per index file.
If this steps do not help, consider using a client/server DBMS, such as PostgreSQL.