Issue Details (XML | Word | Printable)

Key: DERBY-3669
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Minor Minor
Assignee: Knut Anders Hatlen
Reporter: Myrna van Lunteren
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Derby

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

Created: 08/May/08 10:56 PM   Updated: 16/Jul/09 09:24 PM
Component/s: Network Client
Affects Version/s: 10.5.1.1, 10.6.0.0
Fix Version/s: 10.5.2.0, 10.6.0.0

Time Tracking:
Not Specified

File Attachments:
  Size
File Licensed for inclusion in ASF works d3669-1a.diff 2009-07-06 02:49 PM Knut Anders Hatlen 5 kB

Urgency: Normal
Bug behavior facts: Embedded/Client difference
Resolution Date: 09/Jul/09 07:50 AM
Labels:


 Description  « Hide
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.



 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Knut Anders Hatlen added a comment - 06/Jul/09 01:31 PM
Triaged for 10.5.2. Verified that it is still a problem on trunk and set Affects Version accordingly.

Knut Anders Hatlen added a comment - 06/Jul/09 02:49 PM
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 added a comment - 06/Jul/09 07:48 PM
Derbyall and suites.All ran cleanly.

Knut Anders Hatlen added a comment - 09/Jul/09 07:50 AM
Committed revision 792434.

Knut Anders Hatlen added a comment - 09/Jul/09 10:47 AM
Merged fix to 10.5.
Committed revision 792491.