[ 
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

Reply via email to