Handling deadlocks

Program your application or instruct your users to retry data loading statements that encounter a deadlock error.

A number of factors can cause a deadlock error. With concurrent updates and inserts, the database server can encounter a deadlock detected error if the updates are using table scans to evaluate the WHERE clause.

When the etx_contains() operator executes, it immediately generates a hitlist that contains the IDs of all the rows that match the query. The application then begins fetching the rows specified by the hitlist. After the hitlist is generated, but before a row is fetched, a second user session might try to update or delete a row on the hitlist. This places an exclusive lock on that row. The update or insert process waits for a lock on the index that is being held by the original application. When the original application then tries to access that row, the database server issues a deadlock detected or Could Not Position Within a Table error.