Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-6634434

REGRESSION: ODBC's ConnectionPoolDataSource.getPooledConnection() fails.

    XMLWordPrintable

Details

    • Bug
    • Resolution: Future Project
    • P5
    • None
    • 6u2
    • core-libs

    Description

      FULL PRODUCT VERSION :
      java version "1.6.0_02"
      Java(TM) SE Runtime Environment (build 1.6.0_02-b06)
      Java HotSpot(TM) Client VM (build 1.6.0_02-b06, mixed mode, sharing)

      ADDITIONAL OS VERSION INFORMATION :
      Microsoft Windows XP [Version 5.1.2600]

      EXTRA RELEVANT SYSTEM CONFIGURATION :
      Tested on ODBC Data Sources of:
      - SQL Server 2005 instance
      - DB instance
      - Excel spreadsheet

      A DESCRIPTION OF THE PROBLEM :
      Using a ConnectionPoolDataSource for ODBC/JDBC was fine under Java 1.4 and Java 5. However trying to run the same code under a Java 6 VM throws an UnsupportedOperationException.

      Looking at the relevant classes in rt.jar for Java 6, an overloaded version of addConnectionEventListener(ConnectionEventListener) was added to sun.jdbc.odbc.ee.PooledConnection that specified that ConnectionEventListener was of type sun.jdbc.odbc.ee.ConnectionEventListener in addition to the more general javax.sql.ConnectionEventListener. The body of this method was to throw an UnsupportedOperationException.

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Create an ODBC data source under Windows XP.
      Create and configure an ODBC ConnectionPoolDataSource to connect to that data source.
      Attempt to retrieve a PooledConnection from the ODBC ConnectionPoolDataSource.
      Will throw an UnsupportedOperationException

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      No exceptions to be thrown and a PooledConnection object to be returned.
      ACTUAL -
      An UnsupportedOperationException was thrown.

      ERROR MESSAGES/STACK TRACES THAT OCCUR :
      Exception in thread "main" java.lang.UnsupportedOperationException
              at sun.jdbc.odbc.ee.PooledConnection.addConnectionEventListener(PooledConnection.java:281)
              at sun.jdbc.odbc.ee.ConnectionPool.create(ConnectionPool.java:78)
              at sun.jdbc.odbc.ee.ObjectPool.createObject(ObjectPool.java:165)
              at sun.jdbc.odbc.ee.ObjectPool.createObject(ObjectPool.java:155)
              at sun.jdbc.odbc.ee.ObjectPool.checkOut(ObjectPool.java:258)
              at sun.jdbc.odbc.ee.ConnectionPoolDataSource.getPooledConnection(ConnectionPoolDataSource.java:148)
              at TestJDBCODBC.main(TestJDBCODBC.java:20)


      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      sun.jdbc.odbc.ee.ConnectionPoolDataSource dataSource = new sun.jdbc.odbc.ee.ConnectionPoolDataSource("jdbc/OdbcPool");
              dataSource.setMaintenanceInterval("9999999");
              dataSource.setDatabaseName("xls"); // change the name to match the name of the ODBC datasource
              javax.sql.PooledConnection pooledConnection = dataSource.getPooledConnection(); // use the overloaded username password method if the database takes a username/password.
      ---------- END SOURCE ----------

      CUSTOMER SUBMITTED WORKAROUND :
      If code is compiled in Java 5, will run under a Java 5 VM.

      Release Regression From : 5
      The above release value was the last known release where this
      bug was not reproducible. Since then there has been a regression.

      Release Regression From : 5.0
      The above release value was the last known release where this
      bug was not reproducible. Since then there has been a regression.

      Attachments

        Activity

          People

            lancea Lance Andersen
            ryeung Roger Yeung (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: