Forum Stats

  • 3,838,691 Users
  • 2,262,394 Discussions


SQLDriver Connect second connection attempt fails using InstantClient

3566806 Member Posts: 1

I am using 32 bit Oracle Instant Client 18 on Linux with unixODBC2.3.4 to make ODBC connections to Oracle 11 and 12 databases.  My C++ application creates database connections to different databases.  The first one connection SQLDriverConnect calls succeeds, some work is done and then a SQLDisconnect is performed.  The second (following) SQLDriverConnect (sometimes on a different database, sometimes the same database) within the same process does not succeed.  If I omit the prior SQLDisconnect, then the second connection succeeds.  The error is

SQLDriverConnect: RETCODE=-1, State=S1000, Native Error=-1

[unixODBC][Oracle][ODBC][Ora]ORA--0001: Message -1 not found;  product=RDBMS; facility=ORA

I connect with a DSNless connection string (using an ODBCINST.ini entry) of the form:  DRIVER={My Oracle Instant Client};UID=<my uid>;PWD=<my password>;DBQ=<server>:<port>/<SID>

This identical connect string succeeds on the first attempt, so it seems like the problem is not with the connect string or the environment.  I get the same result using the instant client version 12.