Informix problem: ISAM error: lock timeout expired

Sometimes the following error appears:
EDBEngineError with message 'General SQL error. Could not position within a
table (<tablename>).
ISAM error: Lock timeout expired'. Process stopped.