Issue Details (XML | Word | Printable)

Key: DERBY-2559
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Kristian Waagan
Reporter: Myrna van Lunteren
Votes: 0
Watchers: 0
Operations

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

recreating a datasource using javax.naming.Reference from a ClientDataSource40 fails

Created: 17/Apr/07 09:26 PM   Updated: 10/Mar/08 02:43 PM
Return to search
Component/s: Network Client
Affects Version/s: 10.3.1.4, 10.4.1.3
Fix Version/s: 10.3.3.0, 10.4.1.3

Time Tracking:
Not Specified

File Attachments:
  Size
File Licensed for inclusion in ASF works derby-2559-1a.diff 2008-01-30 03:39 PM Kristian Waagan 3 kB
File Licensed for inclusion in ASF works derby-2559-2a-defenses.diff 2008-02-15 12:24 PM Kristian Waagan 2 kB
File Licensed for inclusion in ASF works derby-2559-3a-documentation.diff 2008-02-15 12:24 PM Kristian Waagan 6 kB
File Licensed for inclusion in ASF works derby-2559-3b-documentation.diff 2008-02-18 09:05 AM Kristian Waagan 6 kB

Resolution Date: 10/Mar/08 02:43 PM


 Description  « Hide
Consider the following code snippet from test DataSourceReferenceTest:
--------------------
        Referenceable refDS = (Referenceable) ds;
        Reference dsAsReference = refDS.getReference();
        String factoryClassName = dsAsReference.getFactoryClassName();
        ObjectFactory factory =
            (ObjectFactory) Class.forName(factoryClassName).newInstance();
        Object recreatedDS =
            factory.getObjectInstance(dsAsReference, null, null, null);
---------------------

When ds is a ClientDataSource40 (i.e. when running with jdk16), recreatedDS is null.

Note, that this showed up only after converting the test to junit, because the original test hardcoded the ds to be a ClientDataSource. I confirmed this not to be related to my changes for DERBY-2296 (which prompted me to convert the test), by backing out my changes to ClientBaseDataSource and client/am/Connection and rerunning the test (needed some minor adjustments of expected values table/array).

     

 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Repository Revision Date User Message
ASF #617492 Fri Feb 01 13:06:22 UTC 2008 kristwaa DERBY-2559: recreating a datasource using javax.naming.Reference from a ClientDataSource40 fails. Incremental commit, which enables the factory to create all Derby (client) datasources. However, some mechanisms to avoid throwing exceptions must be added, for instance if a null object is passed. The test that was disabled has been enabled again.
Patch file: DERBY-2559-1a.diff
Files Changed
MODIFY /db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/DataSourceReferenceTest.java
MODIFY /db/derby/code/trunk/java/client/org/apache/derby/client/ClientDataSourceFactory.java

Repository Revision Date User Message
ASF #628647 Mon Feb 18 08:48:46 UTC 2008 kristwaa DERBY-2559: recreating a datasource using javax.naming.Reference from a ClientDataSource40 fails.
A followup patch to avoid throwing an exception when the input arguments are not as expected. The point is to allow another factory to try recreating the object, which will not happen if an exception is thrown. Null will now be returned for null objects and objects whose class does not start with "org.apache.derby.jdbc.Client".
Patch file: DERBY-2559-2a-defenses.diff
Files Changed
MODIFY /db/derby/code/trunk/java/client/org/apache/derby/client/ClientDataSourceFactory.java

Repository Revision Date User Message
ASF #628654 Mon Feb 18 09:03:49 UTC 2008 kristwaa DERBY-2559: recreating a datasource using javax.naming.Reference from a ClientDataSource40 fails.
Documentation / JavaDoc changes (contents and formatting).
Patch file: DERBY-2559-3b-documentation.diff
Files Changed
MODIFY /db/derby/code/trunk/java/client/org/apache/derby/client/ClientDataSourceFactory.java

Repository Revision Date User Message
ASF #632274 Fri Feb 29 09:45:23 UTC 2008 kristwaa DERBY-2559: recreating a datasource using javax.naming.Reference from a ClientDataSource40 fails.
Merged fixes from trunk (10.4): r617492 and r628647.
Files Changed
MODIFY /db/derby/code/branches/10.3/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/DataSourceReferenceTest.java
MODIFY /db/derby/code/branches/10.3/java/client/org/apache/derby/client/ClientDataSourceFactory.java

Repository Revision Date User Message
ASF #635567 Mon Mar 10 14:38:06 UTC 2008 kristwaa DERBY-2559: recreating a datasource using javax.naming.Reference from a ClientDataSource40 fails.
Merged revision 628654 (DERBY-2559-3b-documentation.diff) from trunk and fixed a JavaDoc error caused by a previous patch applied as part of this issue.
Files Changed
MODIFY /db/derby/code/branches/10.3/java/client/org/apache/derby/client/ClientDataSourceFactory.java