Hi All,
As part of porting our product from a legacy machine (AIX 5.1) over 
to a newer machine (AIX 5.3) I ran into the following very nasty 
problem.

Our application could not get its sybase open client 12.5, 32 bit, 
API working on the AIX 5.3 machine.
I Was getting the following error:

dirtalk(aixuat150: /home/dirtalk/paulc/dblibrary):make example1
        xlC -O -I. -I/export/sybase/sybase12.5/OCS-12_5/include 
example1.c /export/sybase/sybase12.5/OCS-12_5/lib/libsybdb.a -lm -o 
example1
dirtalk(aixuat150: /home/dirtalk/paulc/dblibrary):example1
Demo of SQL queries in a command batch
 
Operating-system error:
        Bad file number
DB-Library: Unable to connect: SQL Server is unavailable or does not 
exist.


Funny thing is that the 64 bit library worked on the 5.3 machine but 
the 32 bit one would not.

First I used the dblibrary example, example1 to prove that it wasn't 
our application that was at fault. This sample (when in 32 bit mode) 
built on both machines only worked on AIX 5.1. Same error as above on 
5.3.

We tried everything but basically the solution was as follows.

The Open Client library is an old API and it uses an old AIX OS call 
to wait on activity on a file descriptor called select. (poll is the 
new OS call that should be used) 

The first parameter into select is a bit mask telling the OS which 
file descriptors the application is interested in. On the AIX 5.3 
(newly commissioned system) the default maximum value for the maximum 
number of file descriptors is -1 which means unlimited. 
Unfortunately, the Open Client API was not able to determine this 
ment unlimited, passed the -1 into select and thing threw a wobbly.
(This is the basic explaination)

So to fix the problem, you need to edit the /etc/security/limits file 
and set the maximum number of file descriptors to a reasonable value 
such as 2000.

Problem solved.

Paulc.


Reply via email to