0 Replies Latest reply: Oct 28, 2012 1:28 AM by 970992 RSS

    createConnection from a ConnectionPool takes a long time

      I have Oracle 11g2 on RedHat 5, with default installation of Oracle.

      When I run the following test program, it takes up to 30 seconds to get a connection from the connection pool. The connection pool itself is created immediately. Subsequent createConnection calls from the same pool within the same program also take similar time.

      If instead I try to get a connection directly, i.e., without using a connection pool, I get a connection without delay.


      #include <iostream>
      #include <occi.h>
      #include <map>

      using namespace std;

      int main(){

      oracle::occi::Environment* environment;
      oracle::occi::Connection *con;
      oracle::occi::Statement* stmt;
      oracle::occi::ResultSet* res;
      oracle::occi::ConnectionPool* connPool;


      environment = oracle::occi::Environment::createEnvironment(oracle::occi::Environment::DEFAULT);
      connPool = environment->createConnectionPool("hr", "abcabc", "", 3, 5, 2);
      con = connPool->createConnection("hr", "abcabc");


      catch(oracle::occi::SQLException &e){

      return 0;