This discussion is archived
1 Reply Latest reply: Jan 25, 2013 6:40 AM by jchristian RSS

If createConnection hit "connection lost contact" then "invalid OCI handle"

974570 Newbie
Currently Being Moderated
I am facing a peculiar error with OCCI API :

The c++ application make use of OCCI API to interact with 10 different oracle DBs sequentially in loop, but the moment

pConn = pEnv->createConnection(a_usr, a_pass, a_connection) for 1 slow db is hit with "ORA-03135: connection lost contact" then
for all the remaining other db execution I get a constant error - "ORA-32102: invalid OCI handle" i.e

when the control moves to next db then "pConn = pEnv->createConnection" is successful for all the rest db but when
pRes = pStmt->executeQuery() is executed I get this - "ORA-32102: invalid OCI handle" standard error.

The rest of dbs are live, cross checked with SQLPLUS.

The OCCI resources and handlers are initialized in class and remains in memory till the end of the application. In healthy situation the application works fine for all10 dbs and handles all the ORA errors well except for this situation.

Question: When OCCI hit ORA-03135 error in createConnection method , does OCCI releases the memory (or handlers) ..? If yes then with the same "env" handler why OCCI succeeds in making the next connection and we have correct "con" handler, similarly "createStatement" is also successful but this same "statement" handler the executeQuery() fails with -invalid OCI handle ??

In healthy situation all logic works just fine, I am able to get the data that means sql queries and resultset handle code is perfect.

Thanks in advance,
Vijay

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points