1 Reply Latest reply on Dec 2, 2009 3:37 PM by alwu-Oracle

    Connection Pooling wrapper

    696067
      I was wondering if there is any difference between doing this:

      -----
      OraclePool op = new OraclePool(jdbcURL, userName, password, properties, "OracleSemConnPool");
      Oracle oracle = op.getOracle();
      -----

      And doing this:

      -----
      OracleConnectionPoolDataSource ocpds = new OracleConnectionPoolDataSource();
      ocpds.setDatabaseName(databaseName);
      ocpds.setPortNumber(port);
      ocpds.setUser(userName);
      ocpds.setPassword(password);
      PooledConnection pc = ocpds.getPooledConnection();
      Connection conn = pc.getConnection();
      Oracle oracle = new Oracle(conn);
      -----

      Also, will I get any strange behavior if I register a Data Change Notification like this:

      OraclePool op = new OraclePool(jdbcURL, userName, password, properties, "OracleSemConnPool");
      OracleConnection conn = op.getOracle().getConnection();
      DatabaseChangeRegistration dcr = conn.registerDatabaseChangeNotification(prop);
        • 1. Re: Connection Pooling wrapper
          alwu-Oracle
          Hi,

          OraclePool uses OracleDataSource internally. And OracleConnectionPoolDataSource is a sub class of OracleDataSource. As long as you get an object of OracleConnection out of the data source, there should not be any difference.

          We don't expect strange behaviors when you register a data change notification using connection retrieved from OraclePool. Have you noticed anything?

          Thanks,

          Zhe Wu