Derby
  1. Derby
  2. DERBY-3669

ClientXADataSource fetched from JNDI not identical as originally bound; some properties have String "null" instead of null

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 10.5.1.1, 10.6.1.0
    • Fix Version/s: 10.5.2.0, 10.6.1.0
    • Component/s: Network Client
    • Labels:
      None
    • Urgency:
      Normal
    • Bug behavior facts:
      Embedded/Client difference

      Description

      Running the test XAJNDITest (from old xaJNDI.java) with network server fails because the XADataSource as bound to JNDI, and then fetch from JNDI are not identical.
      This is what the test does to get the XADataSource & to bind & get it from JNDI:
      ----------------
      ...
      XADataSource xads = J2EEDataSource.getXADataSource();
      String dbName = TestConfiguration.getCurrent().getDefaultDatabaseName();
      JDBCDataSource.setBeanProperty(xads, "databaseName", dbName);
      JDBCDataSource.setBeanProperty(xads, "createDatabase", "create");
      JDBCDataSource.setBeanProperty(xads, "description", "XA DataSource");

      Hashtable env = new Hashtable();
      env.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.ldap.LdapCtxFactory");
      // using a system property - these will have to be passed in somehow.
      env.put(Context.PROVIDER_URL, "ldap://" + ldapServer + ":" + ldapPort);
      env.put(Context.SECURITY_AUTHENTICATION, "simple");

      ic.rebind("cn=compareDS, o=" + dnString, xads);
      javax.sql.XADataSource ads =
      (javax.sql.XADataSource)ic.lookup("cn=compareDS, o=" + dnString);
      ...
      -------------------

      Further checking showed that the fetched datasource has a String with value "null" rather than a null value for the following properties:
      dataSourceName, connectionAttributes, traceDirectory, traceFile.

      1. d3669-1a.diff
        5 kB
        Knut Anders Hatlen

        Activity

        Myrna van Lunteren created issue -
        Hide
        Knut Anders Hatlen added a comment -

        Triaged for 10.5.2. Verified that it is still a problem on trunk and set Affects Version accordingly.

        Show
        Knut Anders Hatlen added a comment - Triaged for 10.5.2. Verified that it is still a problem on trunk and set Affects Version accordingly.
        Knut Anders Hatlen made changes -
        Field Original Value New Value
        Bug behavior facts [Embedded/Client difference]
        Affects Version/s 10.6.0.0 [ 12313727 ]
        Urgency Normal
        Knut Anders Hatlen made changes -
        Assignee Knut Anders Hatlen [ knutanders ]
        Knut Anders Hatlen made changes -
        Status Open [ 1 ] In Progress [ 3 ]
        Hide
        Knut Anders Hatlen added a comment -

        The embedded data sources only add the non-null properties to the object returned by getReference(), and there's a comment saying that the string "null" will be returned if a null is added. The attached patch makes the client data sources use the same logic and removes the workaround for the null/"null" issue in XAJNDITest.

        I have only run XAJNDITest on the patch so far. Will run the rest of the regression test suite soon.

        Show
        Knut Anders Hatlen added a comment - The embedded data sources only add the non-null properties to the object returned by getReference(), and there's a comment saying that the string "null" will be returned if a null is added. The attached patch makes the client data sources use the same logic and removes the workaround for the null/"null" issue in XAJNDITest. I have only run XAJNDITest on the patch so far. Will run the rest of the regression test suite soon.
        Knut Anders Hatlen made changes -
        Attachment d3669-1a.diff [ 12412616 ]
        Hide
        Knut Anders Hatlen added a comment -

        Derbyall and suites.All ran cleanly.

        Show
        Knut Anders Hatlen added a comment - Derbyall and suites.All ran cleanly.
        Knut Anders Hatlen made changes -
        Issue & fix info [Patch Available]
        Hide
        Knut Anders Hatlen added a comment -

        Committed revision 792434.

        Show
        Knut Anders Hatlen added a comment - Committed revision 792434.
        Knut Anders Hatlen made changes -
        Status In Progress [ 3 ] Resolved [ 5 ]
        Issue & fix info [Patch Available]
        Fix Version/s 10.6.0.0 [ 12313727 ]
        Resolution Fixed [ 1 ]
        Hide
        Knut Anders Hatlen added a comment -

        Merged fix to 10.5.
        Committed revision 792491.

        Show
        Knut Anders Hatlen added a comment - Merged fix to 10.5. Committed revision 792491.
        Knut Anders Hatlen made changes -
        Fix Version/s 10.5.1.2 [ 12313870 ]
        Affects Version/s 10.5.1.1 [ 12313771 ]
        Kathey Marsden made changes -
        Fix Version/s 10.5.2.0 [ 12314116 ]
        Fix Version/s 10.5.1.2 [ 12313870 ]
        Myrna van Lunteren made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Gavin made changes -
        Workflow jira [ 12430704 ] Default workflow, editable Closed status [ 12800847 ]
        Transition Time In Source Status Execution Times Last Executer Last Execution Date
        Open Open In Progress In Progress
        423d 15h 46m 1 Knut Anders Hatlen 06/Jul/09 14:42
        In Progress In Progress Resolved Resolved
        2d 17h 7m 1 Knut Anders Hatlen 09/Jul/09 07:50
        Resolved Resolved Closed Closed
        553d 13h 46m 1 Myrna van Lunteren 13/Jan/11 21:37

          People

          • Assignee:
            Knut Anders Hatlen
            Reporter:
            Myrna van Lunteren
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development