Applies To:
  • CitectSCADA 5.xx

Sometimes when I call the ctFindFirst() CTAPI function it will hang my application until I get the error message "Deadlock detected" displayed.

What is the cause of this problem?


The Citect CTAPI interface can process up to 3 ctFindFirst queries in parallel. If you issue more than 3 queries, then the fourth and further queries will be queued until one of the original queries has finished. The query is only finished when you call ctFindClose() to destroy the query. If you forget to call ctFindClose() to destroy the query then that query is still pending and will stop future queries.

Check that you do not have more than 3 queries pending at the same time or you are not calling ctFindClose to destroy the query. This could also occur if you pass an incorrect handle to ctFindClose as the query will not really be closed.