Duration of a lock
The program controls the duration of a database lock. A database lock is released when the database closes.
Depending on whether the database uses transactions, table lock durations vary. If the database does not use transactions (that is, if no transaction log exists and you do not use a COMMIT WORK statement), a table lock remains until it is removed by the execution of the UNLOCK TABLE statement.
The duration of table, row, and index locks depends on what SQL statements you use and on whether transactions are in use.
When you use transactions, the end of a transaction releases all table, row, page, and index locks. When a transaction ends, all locks are released.