Subject ODBC application, file descriptors not closed
Author lizwatson02452
Hello,

I am looking for some information and advice about a problem I am
having my application. It is a portable application, which we have run
on both Windows and RedHat Linux, using PostgreSQL, MySQL, and SQL
Server.

The application is a multi-threaded C program which uses ODBC to
access a local Firebird database. The OS is Suse Linux 11.2. I am
using Firebird 2.1.2 (32-bit) and the Firebird ODBC driver 2.0.0.148.

The application creates detached Posix threads to perform tasks. Each
thread calls SQLConnect() to connect to the database, does its work,
then calls SQLDisconnect() prior to thread termination.

Each thread opens 2 file descriptors, one for security2.fdb, the other for isc_lock1.<hostname>. I would expect these file descriptors to be closed when SQLDisconnect() is called, but they remain open. The result is that the number of open file descriptors in my program grows until it reaches the per process limit.

Could someone please give me some insight into how these Firebird file
descriptors are closed? It seems like there ought to be code in either the ODBC driver or Firebird client code that closes them, but for some reason it is not being executed by my program.

Is there a Firebird or ODBC driver configuration parameter that affects the closing of these file descriptors?

Thank you,
Liz