Oninit Logo
The Down System Specialists
+1-913-674-0360
+44-2081-337529
Partnerships Contact
Finderr

-113 ISAM error: the file is locked.

Another user request has opened the file (table) that was requested in exclusive mode. In systems that use files for locking, a tablename.lok file exists. Possibly such a file was left behind when another program terminated abnormally. If you are sure that is the case, you can release the lock by emptying that file. Lock files are not used in many systems, and they are never used with IBM Informix Dynamic Server or IBM Informix OnLine Dynamic Server.

This error occurs with IBM Informix Dynamic Server or IBM Informix OnLine Dynamic Server when a user attempts to access a table that has been locked.

For C-ISAM programs, rerun the program after the file is unlocked. For SQL products, tables are locked explicitly using the LOCK TABLE statement and implicitly during the execution of the CREATE INDEX or ALTER TABLE statement. Rerun the program or query when the table is unlocked.

If you get this error (-113) when using a transaction isolation mode of REPEATABLE READ or SERIALIZABLE, and if your query did not use an index (and therefore had to use a sequential scan of the entire table), the cause of the error might be that another user had either an exclusive lock or a promotable lock on at least one row in the table. If you are in REPEATABLE READ or SERIALIZABLE mode and your query requires a scan (search) of every single record in the table to find all the records that meet the conditions in the WHERE clause, then the engine will need to lock every record in the table to maintain the repeatability of the read. In practice, rather than locking every single record, the engine will try to lock the entire table. But if there are any exclusive locks, or even promotable locks, on any row in the table, then the engine will not be able to get a shared lock on the entire table, and the query will fail.