Subject | File descriptor leak in isc_attach_database |
---|---|
Author | ngcormick |
Post date | 2002-10-03T06:51:41Z |
Using embedded SQL and Interbase 5.5 on SCO I am trying to repeatedly
attempt to connect to a database until I either get a successful
connection, or exceed an arbitrary retry count.
Problem I'm seeing is that everytime the connection fails my program
has an additional 6 file descriptors left open. Obviously, if it
fails too many time the process exceeds the maximum number of allowed
file descriptors. It appears it is the isc_attach_database() call,
that gpre inserts for the CONNECT, that is doing this.
Anyone seen this before, or know of a workaround?
Neil Cormick
Code extract follows:
EXEC SQL
WHENEVER SQLERROR CONTINUE;
for (retry = 0; retry <= VMS_MAX_RETRY_COUNT; retry++)
{
EXEC SQL
CONNECT vdb USER :user PASSWORD :pass;
if (SQLCODE == 0)
return True;
if (retry < VMS_MAX_RETRY_COUNT)
nap(VMS_NAP_TIME); /* wait before trying again */
}
attempt to connect to a database until I either get a successful
connection, or exceed an arbitrary retry count.
Problem I'm seeing is that everytime the connection fails my program
has an additional 6 file descriptors left open. Obviously, if it
fails too many time the process exceeds the maximum number of allowed
file descriptors. It appears it is the isc_attach_database() call,
that gpre inserts for the CONNECT, that is doing this.
Anyone seen this before, or know of a workaround?
Neil Cormick
Code extract follows:
EXEC SQL
WHENEVER SQLERROR CONTINUE;
for (retry = 0; retry <= VMS_MAX_RETRY_COUNT; retry++)
{
EXEC SQL
CONNECT vdb USER :user PASSWORD :pass;
if (SQLCODE == 0)
return True;
if (retry < VMS_MAX_RETRY_COUNT)
nap(VMS_NAP_TIME); /* wait before trying again */
}