Uploaded image for project: 'Derby'
  1. Derby
  2. DERBY-310 Document and/or change Derby client code to match behavior with Embedded driver where possible.
  3. DERBY-1036

Embedded and client differ with regard to Statement.setCursor Name. client will disallow duplicate cursor names. Embedded will allow it.

    XMLWordPrintableJSON

Details

    • Sub-task
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 10.1.3.1, 10.2.1.6
    • 10.2.1.6
    • JDBC, Network Client
    • None

    Description

      In looking at the checkDataSource test for DERBY-435, I hit an issue that the test fails with an exception for duplicate cursor name because it sets the cursor name for two statements to the same thing.

      Embedded seems to allow this, but it seems to me that client might be right here. How could embedded differentiate the two for positioned updates? There is risk to existing applications if embedded is changed to throw the error that should be considered if we decide we need to change the embedded behaviour.

      Below are some details from checkDataSource where I hit this. I will change the names for now as it does not seem relevant to what is being tested.

      PreparedStatement psruState = createFloatStatementForStateChecking(cs1, "select i from ru where i = ?");
      CallableStatement csruState = createFloatCallForStateChecking(cs1, "CALL SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY(?,?)");

      Both of these methods set the cursor name to the same thing:
      s.setCursorName("StokeNewington");

      For embedded it succeeds for client it throws the exception.
      java.sql.SQLException: Duplicate cursor names are not allowed.
      at org.apache.derby.client.am.SqlException.getSQLException(Unknown Source)
      at org.apache.derby.client.am.Statement.setCursorName(Unknown Source)
      at org.apache.derbyTesting.functionTests.tests.jdbcapi.checkDataSource.createFloatStatementForStateChecking(Unknown Source)
      at org.apache.derbyTesting.functionTests.tests.jdbcapi.checkDataSource.runTest(Unknown Source)
      at org.apache.derbyTesting.functionTests.tests.jdbcapi.checkDataSource.main(Unknown Source)

      Attachments

        Activity

          People

            dagw Dag H. Wanvik
            kmarsden Katherine Marsden
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: