You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-dev@db.apache.org by "Rick Hillegas (JIRA)" <de...@db.apache.org> on 2006/02/07 19:38:57 UTC

[jira] Created: (DERBY-930) Add support for autoloading of Derby client drivers

Add support for autoloading of Derby client drivers
---------------------------------------------------

         Key: DERBY-930
         URL: http://issues.apache.org/jira/browse/DERBY-930
     Project: Derby
        Type: New Feature
    Reporter: Rick Hillegas


Write Derby's driver names into the correct spot in derby.jar and derbyclient.jar so that the 1.6 vm autoloads Derby drivers. Section 10.2.1 of the JDBC4 spec describes the details.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (DERBY-930) Add support for autoloading of Derby client drivers

Posted by "Andrew McIntyre (JIRA)" <de...@db.apache.org>.
    [ http://issues.apache.org/jira/browse/DERBY-930?page=comments#action_12365670 ] 

Andrew McIntyre commented on DERBY-930:
---------------------------------------

Looks good, the getCodeSource method looks like it could be reused in sysinfo to take care of  DERBY-668, among others, although I don't know if adding the getProtectionDomain permission would be a serious drawback. Dan could probably answer that question.

Just a couple of minor cleanliness nits: Instead of creating a second section for jar helper targets, could you please move the new common targets to the section 'jar helper targets'? And why did you add dashes to the target names for the new common targets? It's ok, just out of convention with the rest of the target names in the main build.xml.

I'll take a look at the problem when i have a moment and see if i can help.

> Add support for autoloading of Derby client drivers
> ---------------------------------------------------
>
>          Key: DERBY-930
>          URL: http://issues.apache.org/jira/browse/DERBY-930
>      Project: Derby
>         Type: New Feature
>     Reporter: Rick Hillegas
>     Assignee: Rick Hillegas
>  Attachments: bug930.diff, bug930_problem.diff
>
> Write Derby's driver names into the correct spot in derby.jar and derbyclient.jar so that the 1.6 vm autoloads Derby drivers. Section 10.2.1 of the JDBC4 spec describes the details.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Updated: (DERBY-930) Add support for autoloading of Derby client drivers

Posted by "Kathey Marsden (JIRA)" <de...@db.apache.org>.
     [ http://issues.apache.org/jira/browse/DERBY-930?page=all ]

Kathey Marsden updated DERBY-930:
---------------------------------

    Attachment: autoloading_scenarios.html

The attached document autoloading_scenarios.html has three scenarios that need to be considered for our autoloading implementation. Scenario's #1 and #3 have regressions with our current implementation.  Scenario #2 will regress if we move processing of derby.drda.startNetworkServer to connection time.





> Add support for autoloading of Derby client drivers
> ---------------------------------------------------
>
>          Key: DERBY-930
>          URL: http://issues.apache.org/jira/browse/DERBY-930
>      Project: Derby
>         Type: New Feature

>   Components: Build tools, JDBC
>     Reporter: Rick Hillegas
>     Assignee: Rick Hillegas
>      Fix For: 10.2.0.0
>  Attachments: ClassloadingTest.jar, autoloading_scenarios.html, bug930.diff, bug930_problem.diff, bug930_problem2.diff, bug930_rev2.diff, bug930_rev3.diff
>
> Write Derby's driver names into the correct spot in derby.jar and derbyclient.jar so that the 1.6 vm autoloads Derby drivers. Section 10.2.1 of the JDBC4 spec describes the details.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Updated: (DERBY-930) Add support for autoloading of Derby client drivers

Posted by "Kathey Marsden (JIRA)" <de...@db.apache.org>.
     [ http://issues.apache.org/jira/browse/DERBY-930?page=all ]

Kathey Marsden updated DERBY-930:
---------------------------------

    Derby Info: [Existing Application Impact, Release Note Needed]

This change  may impact existing applications as evidenced by the need to change a related test in DERBY-1399.  It requires at least a release note documenting the impact.    Once that has been done it will be easier understand the scope  of the problem and whether this is a regression that needs to be addressed or a behaviour change accepted by the community.

DERBY-1399 has some informaition on this topic.
http://issues.apache.org/jira/browse/DERBY-1399?page=comments#action_12416359

Rick, could you add the release note to this issue?  Bryan posted some helpful Release Note format  info  at: http://wiki.apache.org/db-derby/ReleaseNoteFormat?highlight=%28ReleaseNote%29



> Add support for autoloading of Derby client drivers
> ---------------------------------------------------
>
>          Key: DERBY-930
>          URL: http://issues.apache.org/jira/browse/DERBY-930
>      Project: Derby
>         Type: New Feature

>   Components: Build tools, JDBC
>     Reporter: Rick Hillegas
>     Assignee: Rick Hillegas
>      Fix For: 10.2.0.0
>  Attachments: ClassloadingTest.jar, bug930.diff, bug930_problem.diff, bug930_problem2.diff, bug930_rev2.diff, bug930_rev3.diff
>
> Write Derby's driver names into the correct spot in derby.jar and derbyclient.jar so that the 1.6 vm autoloads Derby drivers. Section 10.2.1 of the JDBC4 spec describes the details.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Reopened: (DERBY-930) Add support for autoloading of Derby client drivers

Posted by "Rick Hillegas (JIRA)" <de...@db.apache.org>.
     [ http://issues.apache.org/jira/browse/DERBY-930?page=all ]

Rick Hillegas reopened DERBY-930:
---------------------------------

             

> Add support for autoloading of Derby client drivers
> ---------------------------------------------------
>
>                 Key: DERBY-930
>                 URL: http://issues.apache.org/jira/browse/DERBY-930
>             Project: Derby
>          Issue Type: New Feature
>          Components: Build tools, JDBC
>            Reporter: Rick Hillegas
>         Assigned To: Rick Hillegas
>             Fix For: 10.2.1.0
>
>         Attachments: autoloading_scenarios.html, bug930.diff, bug930_problem.diff, bug930_problem2.diff, bug930_rev2.diff, bug930_rev3.diff, ClassloadingTest.jar
>
>
> Write Derby's driver names into the correct spot in derby.jar and derbyclient.jar so that the 1.6 vm autoloads Derby drivers. Section 10.2.1 of the JDBC4 spec describes the details.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Updated: (DERBY-930) Add support for autoloading of Derby client drivers

Posted by "Rick Hillegas (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-930?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Rick Hillegas updated DERBY-930:
--------------------------------

    Derby Info:   (was: [Existing Application Impact])

> Add support for autoloading of Derby client drivers
> ---------------------------------------------------
>
>                 Key: DERBY-930
>                 URL: https://issues.apache.org/jira/browse/DERBY-930
>             Project: Derby
>          Issue Type: New Feature
>          Components: Build tools, JDBC
>            Reporter: Rick Hillegas
>         Assigned To: Rick Hillegas
>             Fix For: 10.2.1.6
>
>         Attachments: autoloading_scenarios.html, bug930.diff, bug930_problem.diff, bug930_problem2.diff, bug930_rev2.diff, bug930_rev3.diff, ClassloadingTest.jar
>
>
> Write Derby's driver names into the correct spot in derby.jar and derbyclient.jar so that the 1.6 vm autoloads Derby drivers. Section 10.2.1 of the JDBC4 spec describes the details.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Reopened: (DERBY-930) Add support for autoloading of Derby client drivers

Posted by "Kathey Marsden (JIRA)" <de...@db.apache.org>.
     [ http://issues.apache.org/jira/browse/DERBY-930?page=all ]
     
Kathey Marsden reopened DERBY-930:
----------------------------------


Reopened  because at least release note is needed for behavior change.



> Add support for autoloading of Derby client drivers
> ---------------------------------------------------
>
>          Key: DERBY-930
>          URL: http://issues.apache.org/jira/browse/DERBY-930
>      Project: Derby
>         Type: New Feature

>   Components: Build tools, JDBC
>     Reporter: Rick Hillegas
>     Assignee: Rick Hillegas
>      Fix For: 10.2.0.0
>  Attachments: ClassloadingTest.jar, bug930.diff, bug930_problem.diff, bug930_problem2.diff, bug930_rev2.diff, bug930_rev3.diff
>
> Write Derby's driver names into the correct spot in derby.jar and derbyclient.jar so that the 1.6 vm autoloads Derby drivers. Section 10.2.1 of the JDBC4 spec describes the details.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Updated: (DERBY-930) Add support for autoloading of Derby client drivers

Posted by "Rick Hillegas (JIRA)" <de...@db.apache.org>.
     [ http://issues.apache.org/jira/browse/DERBY-930?page=all ]

Rick Hillegas updated DERBY-930:
--------------------------------

    Attachment: ClassloadingTest.jar

I have attached a jarred up experiment which demonstrates a SecurityManager-induced classloading issue which results in the silent failure to autoload the jdbc driver. The autoloading logic is using the thread context class loader to look in the classpath for all resources with the name META-INF/services/java.sql.Driver. If you run with a SecurityManager, the thread context class loader only finds one META-INF/services/java.sql.Driver, namely, the one in the jar file which contains the calling code. However, if you don't run with a SecurityManager, then the thread context class loader finds many META-INF/services/java.sql.Driver(s), one in each jar file on the classpath.

The experiment contains the following files:

o A.jar - Jar file holding the calling program and its own META-INF/services/java.sql.Driver
o B.jar - Jar file containing another META-INF/services/java.sql.Driver
o AB.policy - Security policy for both jar files
o autoloadslim - Driving script which runs the application both with and without a SecurityManager
o AutoloadClassloader.java - The application which looks for META-INF/services/java.sql.Driver using the thread context class loader


> Add support for autoloading of Derby client drivers
> ---------------------------------------------------
>
>          Key: DERBY-930
>          URL: http://issues.apache.org/jira/browse/DERBY-930
>      Project: Derby
>         Type: New Feature
>     Reporter: Rick Hillegas
>     Assignee: Rick Hillegas
>  Attachments: ClassloadingTest.jar, bug930.diff, bug930_problem.diff, bug930_problem2.diff
>
> Write Derby's driver names into the correct spot in derby.jar and derbyclient.jar so that the 1.6 vm autoloads Derby drivers. Section 10.2.1 of the JDBC4 spec describes the details.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Closed: (DERBY-930) Add support for autoloading of Derby client drivers

Posted by "Rick Hillegas (JIRA)" <de...@db.apache.org>.
     [ http://issues.apache.org/jira/browse/DERBY-930?page=all ]
     
Rick Hillegas closed DERBY-930:
-------------------------------


> Add support for autoloading of Derby client drivers
> ---------------------------------------------------
>
>          Key: DERBY-930
>          URL: http://issues.apache.org/jira/browse/DERBY-930
>      Project: Derby
>         Type: New Feature

>   Components: Build tools, JDBC
>     Reporter: Rick Hillegas
>     Assignee: Rick Hillegas
>      Fix For: 10.2.0.0
>  Attachments: ClassloadingTest.jar, bug930.diff, bug930_problem.diff, bug930_problem2.diff, bug930_rev2.diff, bug930_rev3.diff
>
> Write Derby's driver names into the correct spot in derby.jar and derbyclient.jar so that the 1.6 vm autoloads Derby drivers. Section 10.2.1 of the JDBC4 spec describes the details.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Reopened: (DERBY-930) Add support for autoloading of Derby client drivers

Posted by "Rick Hillegas (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-930?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Rick Hillegas reopened DERBY-930:
---------------------------------


> Add support for autoloading of Derby client drivers
> ---------------------------------------------------
>
>                 Key: DERBY-930
>                 URL: https://issues.apache.org/jira/browse/DERBY-930
>             Project: Derby
>          Issue Type: New Feature
>          Components: Build tools, JDBC
>            Reporter: Rick Hillegas
>         Assigned To: Rick Hillegas
>             Fix For: 10.2.1.6
>
>         Attachments: autoloading_scenarios.html, bug930.diff, bug930_problem.diff, bug930_problem2.diff, bug930_rev2.diff, bug930_rev3.diff, ClassloadingTest.jar
>
>
> Write Derby's driver names into the correct spot in derby.jar and derbyclient.jar so that the 1.6 vm autoloads Derby drivers. Section 10.2.1 of the JDBC4 spec describes the details.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (DERBY-930) Add support for autoloading of Derby client drivers

Posted by "Rick Hillegas (JIRA)" <de...@db.apache.org>.
    [ http://issues.apache.org/jira/browse/DERBY-930?page=comments#action_12376074 ] 

Rick Hillegas commented on DERBY-930:
-------------------------------------

Committed at subversion revision 396638. As of this submission, you need build 81 of jdk1.6 in order to run the jdbc4 tests cleanly.

> Add support for autoloading of Derby client drivers
> ---------------------------------------------------
>
>          Key: DERBY-930
>          URL: http://issues.apache.org/jira/browse/DERBY-930
>      Project: Derby
>         Type: New Feature

>   Components: Build tools, JDBC
>     Reporter: Rick Hillegas
>     Assignee: Rick Hillegas
>  Attachments: ClassloadingTest.jar, bug930.diff, bug930_problem.diff, bug930_problem2.diff, bug930_rev2.diff, bug930_rev3.diff
>
> Write Derby's driver names into the correct spot in derby.jar and derbyclient.jar so that the 1.6 vm autoloads Derby drivers. Section 10.2.1 of the JDBC4 spec describes the details.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Updated: (DERBY-930) Add support for autoloading of Derby client drivers

Posted by "Rick Hillegas (JIRA)" <de...@db.apache.org>.
     [ http://issues.apache.org/jira/browse/DERBY-930?page=all ]

Rick Hillegas updated DERBY-930:
--------------------------------

    Attachment: bug930_problem.diff

I have attached bug930_problem.diff, which demonstrates the problem I am having autoloading Derby drivers under a SecurityManager. The problem case contains the following  files:

A      java\testing\org\apache\derbyTesting\functionTests\tests\jdbcapi\AutoloadDriver.java
A      autoloadscript
M      build.xml
A      autoload.policy

Once you have applied this patch to a clean client, you can reproduce the problem by invoking the script from the directory above trunk:

trunk/autoloadscript


> Add support for autoloading of Derby client drivers
> ---------------------------------------------------
>
>          Key: DERBY-930
>          URL: http://issues.apache.org/jira/browse/DERBY-930
>      Project: Derby
>         Type: New Feature
>     Reporter: Rick Hillegas
>     Assignee: Rick Hillegas
>  Attachments: bug930.diff, bug930_problem.diff
>
> Write Derby's driver names into the correct spot in derby.jar and derbyclient.jar so that the 1.6 vm autoloads Derby drivers. Section 10.2.1 of the JDBC4 spec describes the details.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Resolved: (DERBY-930) Add support for autoloading of Derby client drivers

Posted by "Rick Hillegas (JIRA)" <de...@db.apache.org>.
     [ http://issues.apache.org/jira/browse/DERBY-930?page=all ]
     
Rick Hillegas resolved DERBY-930:
---------------------------------

    Fix Version: 10.2.0.0
     Resolution: Fixed

Fixed with build 81 of jdk1.6.

> Add support for autoloading of Derby client drivers
> ---------------------------------------------------
>
>          Key: DERBY-930
>          URL: http://issues.apache.org/jira/browse/DERBY-930
>      Project: Derby
>         Type: New Feature

>   Components: Build tools, JDBC
>     Reporter: Rick Hillegas
>     Assignee: Rick Hillegas
>      Fix For: 10.2.0.0
>  Attachments: ClassloadingTest.jar, bug930.diff, bug930_problem.diff, bug930_problem2.diff, bug930_rev2.diff, bug930_rev3.diff
>
> Write Derby's driver names into the correct spot in derby.jar and derbyclient.jar so that the 1.6 vm autoloads Derby drivers. Section 10.2.1 of the JDBC4 spec describes the details.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Updated: (DERBY-930) Add support for autoloading of Derby client drivers

Posted by "Rick Hillegas (JIRA)" <de...@db.apache.org>.
     [ http://issues.apache.org/jira/browse/DERBY-930?page=all ]

Rick Hillegas updated DERBY-930:
--------------------------------

    Attachment: bug930_rev2.diff

I have attached a revised patch for this feature: bug930_rev2.diff. This patch cannot be committed until mustang build 81 posts. That build should fix a jdk bug which short-circuits driver autoloading when running under a SecurityManager. This revised patch removes the need for the following permission when checking whether the test is running against the classtree or against jar files:

  permission java.lang.RuntimePermission "getProtectionDomain";

This patch touches the following files:

A      java\testing\org\apache\derbyTesting\functionTests\tests\jdbc4\AutoloadTest.java
M      java\testing\org\apache\derbyTesting\functionTests\suites\jdbc40.runall
M      java\testing\org\apache\derbyTesting\functionTests\util\TestConfiguration.java
M      java\testing\org\apache\derbyTesting\functionTests\util\BaseJDBCTestCase.java
M      build.xml

I will re-run the jdbc4 tests against this patch once mustang build 81 posts.

> Add support for autoloading of Derby client drivers
> ---------------------------------------------------
>
>          Key: DERBY-930
>          URL: http://issues.apache.org/jira/browse/DERBY-930
>      Project: Derby
>         Type: New Feature

>     Reporter: Rick Hillegas
>     Assignee: Rick Hillegas
>  Attachments: ClassloadingTest.jar, bug930.diff, bug930_problem.diff, bug930_problem2.diff, bug930_rev2.diff
>
> Write Derby's driver names into the correct spot in derby.jar and derbyclient.jar so that the 1.6 vm autoloads Derby drivers. Section 10.2.1 of the JDBC4 spec describes the details.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Updated: (DERBY-930) Add support for autoloading of Derby client drivers

Posted by "Mike Matrigali (JIRA)" <de...@db.apache.org>.
     [ http://issues.apache.org/jira/browse/DERBY-930?page=all ]

Mike Matrigali updated DERBY-930:
---------------------------------

    Component: Build tools
               JDBC

> Add support for autoloading of Derby client drivers
> ---------------------------------------------------
>
>          Key: DERBY-930
>          URL: http://issues.apache.org/jira/browse/DERBY-930
>      Project: Derby
>         Type: New Feature

>   Components: Build tools, JDBC
>     Reporter: Rick Hillegas
>     Assignee: Rick Hillegas
>  Attachments: ClassloadingTest.jar, bug930.diff, bug930_problem.diff, bug930_problem2.diff, bug930_rev2.diff
>
> Write Derby's driver names into the correct spot in derby.jar and derbyclient.jar so that the 1.6 vm autoloads Derby drivers. Section 10.2.1 of the JDBC4 spec describes the details.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Closed: (DERBY-930) Add support for autoloading of Derby client drivers

Posted by "Rick Hillegas (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-930?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Rick Hillegas closed DERBY-930.
-------------------------------

    Resolution: Fixed

> Add support for autoloading of Derby client drivers
> ---------------------------------------------------
>
>                 Key: DERBY-930
>                 URL: https://issues.apache.org/jira/browse/DERBY-930
>             Project: Derby
>          Issue Type: New Feature
>          Components: Build tools, JDBC
>            Reporter: Rick Hillegas
>         Assigned To: Rick Hillegas
>             Fix For: 10.2.1.6
>
>         Attachments: autoloading_scenarios.html, bug930.diff, bug930_problem.diff, bug930_problem2.diff, bug930_rev2.diff, bug930_rev3.diff, ClassloadingTest.jar
>
>
> Write Derby's driver names into the correct spot in derby.jar and derbyclient.jar so that the 1.6 vm autoloads Derby drivers. Section 10.2.1 of the JDBC4 spec describes the details.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (DERBY-930) Add support for autoloading of Derby client drivers

Posted by "Rick Hillegas (JIRA)" <de...@db.apache.org>.
    [ http://issues.apache.org/jira/browse/DERBY-930?page=comments#action_12416781 ] 

Rick Hillegas commented on DERBY-930:
-------------------------------------

Here is a second rev of the release note. This attempts to clarify the extra exposure introduced by jdk1.6.

PROBLEM

If an embedded Derby application generates its own Derby properties on the fly, and that Derby application runs in the same 1.6 VM with other JDBC applications, then you are not guaranteed that the Derby engine will pick up the custom properties when it boots.


SYMPTOM

Derby startup behavior will be non-deterministic. Sometimes the engine will pick up the custom properties and sometimes it won't.


CAUSE

JDBC4 introduced driver-autoloading. This causes all JDBC drivers visible to the 1.6 VM to register themselves the first time some application requests a Connection. When the embedded Derby driver registers itself, it also boots the Derby engine and the engine picks up whatever Derby properties are currently visible. An embedded Derby application may want to configure the engine properties before asking for a Connection. That embedded Derby application will not get a chance to configure engine properties if some other JDBC application in the same 1.6 VM runs first and requests a Connection. Two related bugs describe this issue in greater detail: DERBY-1428 and DERBY-1429. DERBY-1428 affects existing customer installations running old versions of Derby on the 1.3, 1.4, and 1.5 VMs. DERBY-1429 describes the extra exposure introduced with the 1.6 VM.


SOLUTION

There is no general solution to the problem. If two self-configuring embedded Derby applications run in the same VM, then only one of them can win.


WORKAROUND

The following workarounds may be useful:

1) Don't configure Derby properties inside your applications. Instead, specify Derby properties either on the VM startup line or in a $DERBY_HOME/derby.properties which remains constant for the VM's lifetime.

2) Don't run on the 1.6 VM. This eliminates the problem provided that you are not running more than one embedded Derby application in the same VM.

3) If (1) and (2) are not possible, then make the self-configuring Derby application run first. 

> Add support for autoloading of Derby client drivers
> ---------------------------------------------------
>
>          Key: DERBY-930
>          URL: http://issues.apache.org/jira/browse/DERBY-930
>      Project: Derby
>         Type: New Feature

>   Components: Build tools, JDBC
>     Reporter: Rick Hillegas
>     Assignee: Rick Hillegas
>      Fix For: 10.2.0.0
>  Attachments: ClassloadingTest.jar, bug930.diff, bug930_problem.diff, bug930_problem2.diff, bug930_rev2.diff, bug930_rev3.diff
>
> Write Derby's driver names into the correct spot in derby.jar and derbyclient.jar so that the 1.6 vm autoloads Derby drivers. Section 10.2.1 of the JDBC4 spec describes the details.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Updated: (DERBY-930) Add support for autoloading of Derby client drivers

Posted by "Rick Hillegas (JIRA)" <de...@db.apache.org>.
     [ http://issues.apache.org/jira/browse/DERBY-930?page=all ]

Rick Hillegas updated DERBY-930:
--------------------------------

    Derby Info: [Existing Application Impact]  (was: [Existing Application Impact, Release Note Needed])

Since this issue was fixed, no release note is needed.

> Add support for autoloading of Derby client drivers
> ---------------------------------------------------
>
>                 Key: DERBY-930
>                 URL: http://issues.apache.org/jira/browse/DERBY-930
>             Project: Derby
>          Issue Type: New Feature
>          Components: Build tools, JDBC
>            Reporter: Rick Hillegas
>         Assigned To: Rick Hillegas
>             Fix For: 10.2.1.0
>
>         Attachments: autoloading_scenarios.html, bug930.diff, bug930_problem.diff, bug930_problem2.diff, bug930_rev2.diff, bug930_rev3.diff, ClassloadingTest.jar
>
>
> Write Derby's driver names into the correct spot in derby.jar and derbyclient.jar so that the 1.6 vm autoloads Derby drivers. Section 10.2.1 of the JDBC4 spec describes the details.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (DERBY-930) Add support for autoloading of Derby client drivers

Posted by "Daniel John Debrunner (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-930?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12475126 ] 

Daniel John Debrunner commented on DERBY-930:
---------------------------------------------

With this issue it seems that the changes made to auto-loading (the two stages) means that the Existing Application Impact flag should be unchecked.

> Add support for autoloading of Derby client drivers
> ---------------------------------------------------
>
>                 Key: DERBY-930
>                 URL: https://issues.apache.org/jira/browse/DERBY-930
>             Project: Derby
>          Issue Type: New Feature
>          Components: Build tools, JDBC
>            Reporter: Rick Hillegas
>         Assigned To: Rick Hillegas
>             Fix For: 10.2.1.6
>
>         Attachments: autoloading_scenarios.html, bug930.diff, bug930_problem.diff, bug930_problem2.diff, bug930_rev2.diff, bug930_rev3.diff, ClassloadingTest.jar
>
>
> Write Derby's driver names into the correct spot in derby.jar and derbyclient.jar so that the 1.6 vm autoloads Derby drivers. Section 10.2.1 of the JDBC4 spec describes the details.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (DERBY-930) Add support for autoloading of Derby client drivers

Posted by "Kathey Marsden (JIRA)" <de...@db.apache.org>.
     [ http://issues.apache.org/jira/browse/DERBY-930?page=all ]

Kathey Marsden updated DERBY-930:
---------------------------------

    Derby Info: [Existing Application Impact, Release Note Needed]  (was: [Regression, Existing Application Impact, Release Note Needed])

DERBY-1459 is logged for the regression caused by this fix, so unchecking the regression checkbox. 


> Add support for autoloading of Derby client drivers
> ---------------------------------------------------
>
>          Key: DERBY-930
>          URL: http://issues.apache.org/jira/browse/DERBY-930
>      Project: Derby
>         Type: New Feature

>   Components: Build tools, JDBC
>     Reporter: Rick Hillegas
>     Assignee: Rick Hillegas
>      Fix For: 10.2.0.0
>  Attachments: ClassloadingTest.jar, autoloading_scenarios.html, bug930.diff, bug930_problem.diff, bug930_problem2.diff, bug930_rev2.diff, bug930_rev3.diff
>
> Write Derby's driver names into the correct spot in derby.jar and derbyclient.jar so that the 1.6 vm autoloads Derby drivers. Section 10.2.1 of the JDBC4 spec describes the details.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (DERBY-930) Add support for autoloading of Derby client drivers

Posted by "Rick Hillegas (JIRA)" <de...@db.apache.org>.
    [ http://issues.apache.org/jira/browse/DERBY-930?page=comments#action_12365476 ] 

Rick Hillegas commented on DERBY-930:
-------------------------------------

Thanks for your quick review, Dan. Some responses follow:

1) I'll change the comments in the policy file to note that the code is generic to DerbyJUnitTest

2) I was simply testing the autoloading added by JDBC4. You are right that setting jdbc.drivers under JDBC3 should cause autoloading too. I will add the AutoloadTest to the jdk1.4 suite while setting jdbc.drivers appropriately.

3) I will investigate wrapping the property reader in a priv block to see if this fixes the permissions problem. I may have to ask you for more advice here before I touch bottom.

> Add support for autoloading of Derby client drivers
> ---------------------------------------------------
>
>          Key: DERBY-930
>          URL: http://issues.apache.org/jira/browse/DERBY-930
>      Project: Derby
>         Type: New Feature
>     Reporter: Rick Hillegas
>     Assignee: Rick Hillegas
>  Attachments: bug930.diff
>
> Write Derby's driver names into the correct spot in derby.jar and derbyclient.jar so that the 1.6 vm autoloads Derby drivers. Section 10.2.1 of the JDBC4 spec describes the details.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Updated: (DERBY-930) Add support for autoloading of Derby client drivers

Posted by "Rick Hillegas (JIRA)" <de...@db.apache.org>.
     [ http://issues.apache.org/jira/browse/DERBY-930?page=all ]

Rick Hillegas updated DERBY-930:
--------------------------------

    Attachment: bug930_problem2.diff

The next attachment (bug930_problem2.diff) shows that the problem is not in Derby's drivers. The problem occurs with a DummyDriver which prints out some diagnostics. Without a SecurityManager, Class.forName() is called on the autoloadable drivers under DriverManager.getConnection(). However, we never get to this Class.forName() when there is a SecurityManager. The contents of this problem case are:

A      java\engine\org\apache\derby\jdbc\DummyDriver.java
M      java\engine\org\apache\derby\jdbc\build.xml
A      java\testing\org\apache\derbyTesting\functionTests\tests\jdbcapi\AutoloadDriver.java
A      autoloadscript
M      build.xml
M      tools\jar\extraDBMSclasses.properties
A      autoload.policy

When there is a SecurityManager, the following invocation of Class.forName() is not reached:

java.lang.Throwable: static initializer trace
        at org.apache.derby.jdbc.DummyDriver.<clinit>(DummyDriver.java:14)
        at java.lang.Class.forName0(Native Method)
        at java.lang.Class.forName(Class.java:247)
        at sun.misc.Service$LazyIterator.next(Service.java:271)
        at java.sql.DriverManager.loadInitialDrivers(DriverManager.java:477)
        at java.sql.DriverManager.initialize(DriverManager.java:579)
        at java.sql.DriverManager.getConnection(DriverManager.java:532)
        at java.sql.DriverManager.getConnection(DriverManager.java:150)
        at org.apache.derbyTesting.functionTests.tests.jdbcapi.AutoloadDriver.getConnection(AutoloadDriver.java:80)
        at org.apache.derbyTesting.functionTests.tests.jdbcapi.AutoloadDriver.execute(AutoloadDriver.java:52)
        at org.apache.derbyTesting.functionTests.tests.jdbcapi.AutoloadDriver.main(AutoloadDriver.java:41)


> Add support for autoloading of Derby client drivers
> ---------------------------------------------------
>
>          Key: DERBY-930
>          URL: http://issues.apache.org/jira/browse/DERBY-930
>      Project: Derby
>         Type: New Feature
>     Reporter: Rick Hillegas
>     Assignee: Rick Hillegas
>  Attachments: bug930.diff, bug930_problem.diff, bug930_problem2.diff
>
> Write Derby's driver names into the correct spot in derby.jar and derbyclient.jar so that the 1.6 vm autoloads Derby drivers. Section 10.2.1 of the JDBC4 spec describes the details.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (DERBY-930) Add support for autoloading of Derby client drivers

Posted by "Rick Hillegas (JIRA)" <de...@db.apache.org>.
    [ http://issues.apache.org/jira/browse/DERBY-930?page=comments#action_12365733 ] 

Rick Hillegas commented on DERBY-930:
-------------------------------------

Thanks for the review, Andrew. I will airbrush build.xml as you requested. The dashes in the new target names are a convention I brought from a previous life: they are a prefix I'm used to putting on targets which are for internal use only (not to be called directly by the user who invokes ant). I can remove the dashes if they seem out of place.

This patch is, of course, not ready for committing. I have to resolve the SecurityManager problem before I submit a new patch.

Regards,
-Rick

> Add support for autoloading of Derby client drivers
> ---------------------------------------------------
>
>          Key: DERBY-930
>          URL: http://issues.apache.org/jira/browse/DERBY-930
>      Project: Derby
>         Type: New Feature
>     Reporter: Rick Hillegas
>     Assignee: Rick Hillegas
>  Attachments: bug930.diff, bug930_problem.diff
>
> Write Derby's driver names into the correct spot in derby.jar and derbyclient.jar so that the 1.6 vm autoloads Derby drivers. Section 10.2.1 of the JDBC4 spec describes the details.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Updated: (DERBY-930) Add support for autoloading of Derby client drivers

Posted by "Rick Hillegas (JIRA)" <de...@db.apache.org>.
     [ http://issues.apache.org/jira/browse/DERBY-930?page=all ]

Rick Hillegas updated DERBY-930:
--------------------------------

    Attachment: bug930_rev3.diff

Attaching bug930_rev3.diff, which makes a small change to the test for whether we're running with jar files. Build 81 of jdk1.6 fixes the problem with autoloading under a SecurityManager. The AutoloadTest now runs correctly.

> Add support for autoloading of Derby client drivers
> ---------------------------------------------------
>
>          Key: DERBY-930
>          URL: http://issues.apache.org/jira/browse/DERBY-930
>      Project: Derby
>         Type: New Feature

>   Components: Build tools, JDBC
>     Reporter: Rick Hillegas
>     Assignee: Rick Hillegas
>  Attachments: ClassloadingTest.jar, bug930.diff, bug930_problem.diff, bug930_problem2.diff, bug930_rev2.diff, bug930_rev3.diff
>
> Write Derby's driver names into the correct spot in derby.jar and derbyclient.jar so that the 1.6 vm autoloads Derby drivers. Section 10.2.1 of the JDBC4 spec describes the details.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Updated: (DERBY-930) Add support for autoloading of Derby client drivers

Posted by "Rick Hillegas (JIRA)" <de...@db.apache.org>.
     [ http://issues.apache.org/jira/browse/DERBY-930?page=all ]

Rick Hillegas updated DERBY-930:
--------------------------------

    Derby Info: [Existing Application Impact, Regression, Release Note Needed]  (was: [Existing Application Impact, Release Note Needed])

> Add support for autoloading of Derby client drivers
> ---------------------------------------------------
>
>          Key: DERBY-930
>          URL: http://issues.apache.org/jira/browse/DERBY-930
>      Project: Derby
>         Type: New Feature

>   Components: Build tools, JDBC
>     Reporter: Rick Hillegas
>     Assignee: Rick Hillegas
>      Fix For: 10.2.0.0
>  Attachments: ClassloadingTest.jar, bug930.diff, bug930_problem.diff, bug930_problem2.diff, bug930_rev2.diff, bug930_rev3.diff
>
> Write Derby's driver names into the correct spot in derby.jar and derbyclient.jar so that the 1.6 vm autoloads Derby drivers. Section 10.2.1 of the JDBC4 spec describes the details.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Assigned: (DERBY-930) Add support for autoloading of Derby client drivers

Posted by "Rick Hillegas (JIRA)" <de...@db.apache.org>.
     [ http://issues.apache.org/jira/browse/DERBY-930?page=all ]

Rick Hillegas reassigned DERBY-930:
-----------------------------------

    Assign To: Rick Hillegas

> Add support for autoloading of Derby client drivers
> ---------------------------------------------------
>
>          Key: DERBY-930
>          URL: http://issues.apache.org/jira/browse/DERBY-930
>      Project: Derby
>         Type: New Feature
>     Reporter: Rick Hillegas
>     Assignee: Rick Hillegas

>
> Write Derby's driver names into the correct spot in derby.jar and derbyclient.jar so that the 1.6 vm autoloads Derby drivers. Section 10.2.1 of the JDBC4 spec describes the details.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Updated: (DERBY-930) Add support for autoloading of Derby client drivers

Posted by "Rick Hillegas (JIRA)" <de...@db.apache.org>.
     [ http://issues.apache.org/jira/browse/DERBY-930?page=all ]

Rick Hillegas updated DERBY-930:
--------------------------------

    Attachment: bug930.diff

This patch makes the jar building targets stuff a) derby.jar with the embedded driver name and b) derbyclient.jar with the client driver name. Some details follow:

o trunk/build.xml - Created a single target for making the META-INF directory. Previously, this logic was cut-and-pasted across the jarring targets.

o trunk/build.xml - Added logic to create META-INF/services/java.sql.Driver files to derby.jar and derbyclient.jar

o AutoloadTest.java - New test to verify that the Derby drivers autoload when run from our jar files.

I disabled the security manager for AutoloadTest. The reasons for this are documented in AutoloadTest_app.properties: When running under our test harness from jar files under jdk1.6, system properties can't be read. This causes the drivers to silently fail to autoload. Note that when running under jdk1.6 from jar files outside our test harness, the drivers correctly autoload.

The new test is wired into the jdbc4 suite. The suite runs cleanly under 1.6 against the class tree and against the Derby jar files. The test itself runs cleanly embedded and with the Derby client under 1.6 and 1.4 and against the class tree and the jar files.

Here are the patch contents:

A      java\testing\org\apache\derbyTesting\functionTests\tests\junitTests\jdbcapi
A      java\testing\org\apache\derbyTesting\functionTests\tests\junitTests\jdbcapi\AutoloadTest_app.properties
A      java\testing\org\apache\derbyTesting\functionTests\tests\junitTests\jdbcapi\AutoloadTest.java
A      java\testing\org\apache\derbyTesting\functionTests\tests\junitTests\jdbcapi\build.xml
M      java\testing\org\apache\derbyTesting\functionTests\suites\jdbc4.runall
M      java\testing\org\apache\derbyTesting\functionTests\util\DerbyJUnitTest.java
M      java\testing\org\apache\derbyTesting\functionTests\util\derby_tests.policy
M      java\testing\build.xml
M      build.xml

> Add support for autoloading of Derby client drivers
> ---------------------------------------------------
>
>          Key: DERBY-930
>          URL: http://issues.apache.org/jira/browse/DERBY-930
>      Project: Derby
>         Type: New Feature
>     Reporter: Rick Hillegas
>     Assignee: Rick Hillegas
>  Attachments: bug930.diff
>
> Write Derby's driver names into the correct spot in derby.jar and derbyclient.jar so that the 1.6 vm autoloads Derby drivers. Section 10.2.1 of the JDBC4 spec describes the details.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (DERBY-930) Add support for autoloading of Derby client drivers

Posted by "Daniel John Debrunner (JIRA)" <de...@db.apache.org>.
    [ http://issues.apache.org/jira/browse/DERBY-930?page=comments#action_12365472 ] 

Daniel John Debrunner commented on DERBY-930:
---------------------------------------------

In the policy file the patch has lines like:

+  // junitTests/jdbcapi/AutoloadTest.java
+  permission java.lang.RuntimePermission "getProtectionDomain";

but this permission is for generic code in DerbyJUnitTest, not just that specific test.

When the test runs with JDK 1.4 is it auto-loading the driver? I couldn't see any setting of jdbc.drivers so I'm unclear what would cause the driver to auto-load.

>From earlier comment:
> I disabled the security manager for AutoloadTest. The reasons for this are documented in AutoloadTest_app.properties: When running under our test harness from jar files under jdk1.6, system properties can't be read. This causes the drivers to silently fail to autoload. Note that when running under jdk1.6 from jar files outside our test harness, the drivers correctly autoload.

This is somewhat troubling, I don't understand what reading system properties has to do with the auto-loading of JDBC drivers by the java virtual machine. Can you maybe explain more why this fails for you, rather than just disabling the security manager. Disabling the security manager should not be a common option. I think it's as simple as you are not fetching the System property in a priv block.


> Add support for autoloading of Derby client drivers
> ---------------------------------------------------
>
>          Key: DERBY-930
>          URL: http://issues.apache.org/jira/browse/DERBY-930
>      Project: Derby
>         Type: New Feature
>     Reporter: Rick Hillegas
>     Assignee: Rick Hillegas
>  Attachments: bug930.diff
>
> Write Derby's driver names into the correct spot in derby.jar and derbyclient.jar so that the 1.6 vm autoloads Derby drivers. Section 10.2.1 of the JDBC4 spec describes the details.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


Re: [jira] Commented: (DERBY-930) Add support for autoloading of Derby client drivers

Posted by Kathey Marsden <km...@sbcglobal.net>.
Rick Hillegas (JIRA) wrote:

>
>I think that derby-dev should continue to discuss the issue which Olav has analyzed in DERBY-1399. I will continue this discussion shortly.
>
>  
>
If   the behaviour change for DERBY-930 is intentional a special release 
note is needed for this issue  in the section  for
"Changes that might affect existing applications":

It might read something like this ...

PROBLEM:  Autoloading of driver  causes  changes to behavior of  derby 
properties.

SYMPTOM: 
Derby does not recognize  derby.system.home or other properties set by  
the application and creates database in the wrong location or  fails to 
recognize properties.

CAUSE:
Automatic loading of the driver with JDBC 4.0  causes  derby to be  
booted before the derby.system.home property has been set.  Therefore 
the property is ignored.

SOLUTION:
There is no product solution to this issue. 

WORKAROUND:
The only workaround is to set derby.system.home before any connection is 
made to any database.   For example derby.system.home can be specified 
on the command line with -Dderby.system.home=<location>


Now that I put it like that I can imagine all the users in the world 
that this is going to impact and I become more convinced that this is a 
bug and a serious regression.    I liked the suggestion to defer booting 
derby embedded until the first embedded connection is made, but 
apparently there are other implications for 
derby.drda.startNetworkServer that I don't quite understand yet. IMHO 
they all should be fixed if possible so we don't break existing 
applications.

Kathey





[jira] Commented: (DERBY-930) Add support for autoloading of Derby client drivers

Posted by "Rick Hillegas (JIRA)" <de...@db.apache.org>.
    [ http://issues.apache.org/jira/browse/DERBY-930?page=comments#action_12416591 ] 

Rick Hillegas commented on DERBY-930:
-------------------------------------

I think that derby-dev should continue to discuss the issue which Olav has analyzed in DERBY-1399. I will continue this discussion shortly.

Based on that discussion, we can decide what to put in a release note. It's unclear to me how to divide JDBC4 functionality among release notes. This issue may deserve a release not by itself, or it may be a subcase of some larger release note for JDBC4 features. But in any event, I agree we should attach some description to this issue for rollup somewhere in the 10.2 release notes.

In addition, this behavior should be documented in the user guides. The analysis of user guide changes can be found in DERBY-1271.

> Add support for autoloading of Derby client drivers
> ---------------------------------------------------
>
>          Key: DERBY-930
>          URL: http://issues.apache.org/jira/browse/DERBY-930
>      Project: Derby
>         Type: New Feature

>   Components: Build tools, JDBC
>     Reporter: Rick Hillegas
>     Assignee: Rick Hillegas
>      Fix For: 10.2.0.0
>  Attachments: ClassloadingTest.jar, bug930.diff, bug930_problem.diff, bug930_problem2.diff, bug930_rev2.diff, bug930_rev3.diff
>
> Write Derby's driver names into the correct spot in derby.jar and derbyclient.jar so that the 1.6 vm autoloads Derby drivers. Section 10.2.1 of the JDBC4 spec describes the details.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Closed: (DERBY-930) Add support for autoloading of Derby client drivers

Posted by "Rick Hillegas (JIRA)" <de...@db.apache.org>.
     [ http://issues.apache.org/jira/browse/DERBY-930?page=all ]

Rick Hillegas closed DERBY-930.
-------------------------------

    Resolution: Fixed

> Add support for autoloading of Derby client drivers
> ---------------------------------------------------
>
>                 Key: DERBY-930
>                 URL: http://issues.apache.org/jira/browse/DERBY-930
>             Project: Derby
>          Issue Type: New Feature
>          Components: Build tools, JDBC
>            Reporter: Rick Hillegas
>         Assigned To: Rick Hillegas
>             Fix For: 10.2.1.0
>
>         Attachments: autoloading_scenarios.html, bug930.diff, bug930_problem.diff, bug930_problem2.diff, bug930_rev2.diff, bug930_rev3.diff, ClassloadingTest.jar
>
>
> Write Derby's driver names into the correct spot in derby.jar and derbyclient.jar so that the 1.6 vm autoloads Derby drivers. Section 10.2.1 of the JDBC4 spec describes the details.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Closed: (DERBY-930) Add support for autoloading of Derby client drivers

Posted by "Rick Hillegas (JIRA)" <de...@db.apache.org>.
     [ http://issues.apache.org/jira/browse/DERBY-930?page=all ]

Rick Hillegas closed DERBY-930.
-------------------------------

    Resolution: Fixed
    Derby Info: [Existing Application Impact, Release Note Needed]  (was: [Release Note Needed, Existing Application Impact])

Closing this issue because DERBY-1459 addresses the problem.

> Add support for autoloading of Derby client drivers
> ---------------------------------------------------
>
>                 Key: DERBY-930
>                 URL: http://issues.apache.org/jira/browse/DERBY-930
>             Project: Derby
>          Issue Type: New Feature
>          Components: Build tools, JDBC
>            Reporter: Rick Hillegas
>         Assigned To: Rick Hillegas
>             Fix For: 10.2.0.0
>
>         Attachments: autoloading_scenarios.html, bug930.diff, bug930_problem.diff, bug930_problem2.diff, bug930_rev2.diff, bug930_rev3.diff, ClassloadingTest.jar
>
>
> Write Derby's driver names into the correct spot in derby.jar and derbyclient.jar so that the 1.6 vm autoloads Derby drivers. Section 10.2.1 of the JDBC4 spec describes the details.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Re: [jira] Commented: (DERBY-930) Add support for autoloading of Derby client drivers

Posted by Rick Hillegas <Ri...@Sun.COM>.
Hi Bryan,

Thanks for the quick response. I have revised the release note. 
Hopefully, it now describes the VM-specific issues better.

Regards,
-Rick

Bryan Pendleton wrote:

> Rick Hillegas (JIRA) wrote:
>
>> Adding a release note for this issue:
>
>
> Hi Rick, thanks for writing the release note.
>
> It wasn't clear to me from reading the release note whether this issue
> only affects JDK 1.6 environments, or whether it can arise under older
> VMs as well.
>
> If it only affects JDK 1.6 environments, perhaps we could change the
> release note to read:
>
>   If an embedded Derby application runs in a JDK 1.6/JDBC4 environment,
>   and generates its own Derby properties on the fly, and...
>
> thanks,
>
> bryan
>
>


Re: [jira] Commented: (DERBY-930) Add support for autoloading of Derby client drivers

Posted by Bryan Pendleton <bp...@amberpoint.com>.
Rick Hillegas (JIRA) wrote:
> Adding a release note for this issue:

Hi Rick, thanks for writing the release note.

It wasn't clear to me from reading the release note whether this issue
only affects JDK 1.6 environments, or whether it can arise under older
VMs as well.

If it only affects JDK 1.6 environments, perhaps we could change the
release note to read:

   If an embedded Derby application runs in a JDK 1.6/JDBC4 environment,
   and generates its own Derby properties on the fly, and...

thanks,

bryan



[jira] Commented: (DERBY-930) Add support for autoloading of Derby client drivers

Posted by "Rick Hillegas (JIRA)" <de...@db.apache.org>.
    [ http://issues.apache.org/jira/browse/DERBY-930?page=comments#action_12416775 ] 

Rick Hillegas commented on DERBY-930:
-------------------------------------

Adding a release note for this issue:

PROBLEM

If an embedded Derby application generates its own Derby properties on the fly, and that Derby application runs in the same VM with other JDBC applications, then you are not guaranteed that the Derby engine will pick up the custom properties when it boots.


SYMPTOM

Derby startup behavior will be non-deterministic. Sometimes the engine will pick up the custom properties and sometimes it won't.


CAUSE

JDBC4 introduced driver-autoloading. This causes all JDBC drivers visible to the VM to register themselves the first time some application requests a Connection. When the embedded Derby driver registers itself, it also boots the Derby engine and the engine picks up whatever Derby properties are currently visible. An embedded Derby application may want to configure the engine properties before asking for a Connection. That embedded Derby application will not get a chance to configure engine properties if some other JDBC application in the same VM runs first and requests a Connection. Two related bugs describe this issue in greater detail: DERBY-1428 and DERBY-1429.


SOLUTION

There is no general solution to the problem. If two self-configuring embedded Derby applications run in the same VM, then only one of them can win.


WORKAROUND

The following workarounds may be useful:

1) Don't configure Derby properties inside your applications. Instead, specify Derby properties either on the VM startup line or in a $DERBY_HOME/derby.properties which remains constant for the VM's lifetime.

2) If (1) is not possible, then make the self-configuring Derby application run first.




> Add support for autoloading of Derby client drivers
> ---------------------------------------------------
>
>          Key: DERBY-930
>          URL: http://issues.apache.org/jira/browse/DERBY-930
>      Project: Derby
>         Type: New Feature

>   Components: Build tools, JDBC
>     Reporter: Rick Hillegas
>     Assignee: Rick Hillegas
>      Fix For: 10.2.0.0
>  Attachments: ClassloadingTest.jar, bug930.diff, bug930_problem.diff, bug930_problem2.diff, bug930_rev2.diff, bug930_rev3.diff
>
> Write Derby's driver names into the correct spot in derby.jar and derbyclient.jar so that the 1.6 vm autoloads Derby drivers. Section 10.2.1 of the JDBC4 spec describes the details.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira