db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andrew McIntyre" <mcintyr...@gmail.com>
Subject Re: derbytools.jar loading derbyclient.jar
Date Wed, 01 Mar 2006 06:16:27 GMT
On 2/28/06, Kathey Marsden <kmarsdenderby@sbcglobal.net> wrote:
> See  Mixed Version Support at:
> http://wiki.apache.org/db-derby/SharedComponentVersioningGuidelines

That page describes how shared components should behave in a mixed
version environment, but let's look at the contract:

*Two applications should be able to use one version of the Derby
network client driver and a different version of the Derby embedded
driver within the same Java VM without having to resort to creating
specialized classloaders.

This would still be true, but care must be taken to put derbytools.jar
after any older derby.jar/derbyclient.jar you would like to use.

*Older versions of Derby jars will get their expected behavior in a
mixed version environment regardless of jar ordering.

This would not be true, if derbytools.jar is in the same location as
derby.jar/derbyclient.jar and first in the classpath. The older jar
would need to come first. BUT, this statement was agreed upon based on
talking about shared components and how the functionality in shared
environments would behave. Your concern may apply equally in this
case, and I'm curious if it does.

Note that the result would not be anomalous behavior by shared code:
you just get the newer driver, not unlike the situation now if, for
example, a newer version gets put in jre/lib/ext and the user puts an
older one on the classpath. (which means getting sysinfo to report
these situations is imperative)

*Newer versions of Derby jars will get new behavior if the newer jar
files are loaded first, and older behavior if the older jar files are
loaded first.

This would be true, although this statement is very specific to shared
components. In general new jars first = new behavior/new drivers, old
jars first = old behavior/old drivers.

Note that this change has no actual impact on the functionality of
either client or engine, only on the resultant classpath when
derbytools.jar is loaded.


> > For currently releases that would mean:
> 10.1 derby client.jar  with  10.2  derby.jar
> 10.2 derby.jar with 10.1 derby client.jar

These combinations would be unaffected - if that's all you have in
your classpath. if we expand that with the tools jar, and assume
derby.jar/derbyclient.jar are in the same place as tools:

10.2 tools : 10.1 client : 10.1 engine = 10.2 client / 10.2 engine
10.1 client : 10.2 tools : 10.1 engine = 10.1 client / 10.2 engine
10.1 derby : 10.1 engine : 10.2 tools = 10.1 client / 10.1 engine

Of course, I'm not sure what sort of usage (outside of our tests)
would lead to such a pattern as the above. I'd expand with e.g. 10.2
derby.jar in there, but that would lead to far too many premutations
to stick in an email. But you get the idea.

How are we assuming classpath is being set for the JVM that would lead
to mixed versions in the classpath? By two different applications'
installers? By being in a library directory in which all jars are
added to the classpath? By the various extension loading mechanisms?
Via app server classloaders and .war files? All of the above? I'm just
trying to get a handle on the types of situations that would lead to
jars of mixed versions being in the classpath so that I can understand
the risks that would be present.


View raw message