Derby
  1. Derby
  2. DERBY-154

Network Client should not allow creation of statements with scroll sensitive read-only and updatable resultsets?

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Won't Fix
    • Affects Version/s: 10.0.2.1
    • Fix Version/s: None
    • Component/s: Network Client
    • Labels:
      None

      Description

      Derby in embedded mode does not support scroll sensitive resultsets in both read-only and updatable modes. But when I write a simple test program in Network Server configuration, it appears that scroll sensitive resultsets are supported both in read-only and updatable modes. Is that correct?

      Connection con = DriverManager.getConnection("jdbc:derby:net://localhost:1527/db1drda;create=true:retrieveMessagesFromServerOnGetMessage=true:deferPrepares=false;", "app", "app");
      Statement s = con.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_READ_ONLY);
      SQLWarning warnings = con.getWarnings();
      while (warnings != null)
      {
      System.out.println("warnings on connection = " + warnings);
      warnings = warnings.getNextWarning();
      }
      System.out.println("Did we get TYPE_SCROLL_SENSITIVE? " + (s.getResultSetType() == ResultSet.TYPE_SCROLL_SENSITIVE));
      System.out.println("Did we get CONCUR_READ_ONLY? " + (s.getResultSetConcurrency() == ResultSet.CONCUR_READ_ONLY));

      s = con.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_UPDATABLE);
      System.out.println("Did we get TYPE_SCROLL_SENSITIVE? " + (s.getResultSetType() == ResultSet.TYPE_SCROLL_SENSITIVE));
      System.out.println("Did we get CONCUR_UPDATABLE? " + (s.getResultSetConcurrency() == ResultSet.CONCUR_UPDATABLE));

      And the output in Network Server mode for above test case is
      Did we get TYPE_SCROLL_SENSITIVE? true
      Did we get CONCUR_READ_ONLY? true
      Did we get TYPE_SCROLL_SENSITIVE? true
      Did we get CONCUR_UPDATABLE? true

        Activity

        Hide
        Myrna van Lunteren added a comment -

        I chose to resolve as won't fix to reflect that we're not going to pursue changes for the JCC Driver.

        Show
        Myrna van Lunteren added a comment - I chose to resolve as won't fix to reflect that we're not going to pursue changes for the JCC Driver.
        Hide
        Myrna van Lunteren added a comment -

        [10.5.2 Triage]
        I made a repro using the Derby Net client instead of the JCC driver
        ( Connection con = DriverManager.getConnection("jdbc:derby://localhost:1527/db1drda;create=true;")
        and got the following output:

        Did we get TYPE_SCROLL_SENSITIVE? false
        Did we get CONCUR_READ_ONLY? true
        Did we get TYPE_SCROLL_SENSITIVE? false
        Did we get CONCUR_UPDATABLE? true

        The output for embedded is exactly the same.
        As we no longer cater towards the JCC driver, I don't think there's anything more to do here.

        Show
        Myrna van Lunteren added a comment - [10.5.2 Triage] I made a repro using the Derby Net client instead of the JCC driver ( Connection con = DriverManager.getConnection("jdbc:derby://localhost:1527/db1drda;create=true;") and got the following output: Did we get TYPE_SCROLL_SENSITIVE? false Did we get CONCUR_READ_ONLY? true Did we get TYPE_SCROLL_SENSITIVE? false Did we get CONCUR_UPDATABLE? true The output for embedded is exactly the same. As we no longer cater towards the JCC driver, I don't think there's anything more to do here.
        Hide
        Mamta A. Satoor added a comment -

        I did some looking through the JCC driver code and the problem is in how JCC class Connection.java handles resultset type downgrading. Since Derby does not support scroll sensitive resultsets, JCC code should downgrade resultset type to scroll insensitive. I will try to work with the JCC team on this. People working on the Derby Net Client - similar change might be necessary in the Derby Net Client code too.

        Show
        Mamta A. Satoor added a comment - I did some looking through the JCC driver code and the problem is in how JCC class Connection.java handles resultset type downgrading. Since Derby does not support scroll sensitive resultsets, JCC code should downgrade resultset type to scroll insensitive. I will try to work with the JCC team on this. People working on the Derby Net Client - similar change might be necessary in the Derby Net Client code too.

          People

          • Assignee:
            Unassigned
            Reporter:
            Mamta A. Satoor
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development