db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Knut Anders Hatlen (Updated) (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (DERBY-4845) Improve the dependency tracking for our build targets
Date Thu, 10 Nov 2011 13:13:52 GMT

     [ https://issues.apache.org/jira/browse/DERBY-4845?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Knut Anders Hatlen updated DERBY-4845:
--------------------------------------

    Attachment: d4845-buildbreak.diff

The previous commit broke the build for those who have
jsr169compile.classpath configured:
http://mail-archives.apache.org/mod_mbox/db-derby-dev/201111.mbox/%3C20111110092611.21938.qmail%40tyr72%3E

The reason seems to be that dependencies on Java SE has sneaked into
code that's supposed to work on CDC/Foundation Profile. It didn't use
to fail at compile time before because the classes were compiled by a
different target than intended. When we removed some implicit build
dependencies in the previous patch, these classes ended up being
compiled using the intended target, which used a stricter compile
classpath than the implicit target used before.

This problem could also be seen before the previous commit, by
touching java/engine/org/apache/derby/impl/db/SlaveDatabase.java and
doing an incremental build on an otherwise fully compiled source tree.
This is exactly the kind of problems we want to fix in this JIRA
issue.

I think this isn't just a build problem, but also a run-time problem
on CDC/FP. For example, the following code raises a
java.lang.NoClassDefFoundError with Derby 10.8.2.2 on Oracle Java ME
Embedded Client:

EmbeddedSimpleDataSource ds = new EmbeddedSimpleDataSource();
ds.setDatabaseName("wombat");
ds.setCreateDatabase("create");
ds.getConnection().close();

ds.setCreateDatabase(null);
ds.setDatabaseName(null);
ds.setShutdownDatabase("shutdown");
ds.setConnectionAttributes("deregister=true");
ds.getConnection();

When the attached patch is applied, it changes to the expected
exception: java.sql.SQLException: Derby system shutdown.

Here's a description of the changes in d4845-buildbreak.diff:

* java/engine/org/apache/derby/impl/db/SlaveDatabase.java:

This class is supposed to be compiled against CDC/FP libraries (and
now it actually is), but it references java.sql.Driver and
java.sql.DriverManager, which are not available on that platform. The
patch changes the code to use InternalDriver to shut down the
database. (The original code didn't cause any run-time failures on
CDC/FP because it the code is wrapped in a try/catch that ignores all
exceptions.)

* java/engine/org/apache/derby/iapi/reference/Limits.java
* java/engine/org/apache/derby/impl/jdbc/LOBStoredProcedure.java
* java/engine/org/apache/derby/impl/sql/catalog/DataDictionaryImpl.java

DataDictionaryImpl imported LOBStoredProcedure in order to get a
constant. Since LOBStoredProcedure is not supposed to work on CDC/FP,
whereas DataDictionaryImpl is, DataDictionaryImpl shouldn't reference
it directly. The patch moves the constants to the Limits interface so
that DataDictionaryImpl doesn't have to import LOBStoredProcedure.

* java/engine/org/apache/derby/jdbc/AutoloadedDriver.java
* java/engine/org/apache/derby/jdbc/InternalDriver.java

InternalDriver calls AutoloadedDriver.setDeregister(), but it should
not reference code that only works on Java SE, since it is supposed to
work on CDC/FP. The patch moves the methods setDeregister() and
getDeregister() to InternalDriver and lets AutoloadedDriver fetch this
info from InternalDriver instead.


The build works again with jsr169compile.classpath set when the patch
is applied. No problems were found when running suites.All and
derbyall.

Committed revision 1200293.
                
> Improve the dependency tracking for our build targets
> -----------------------------------------------------
>
>                 Key: DERBY-4845
>                 URL: https://issues.apache.org/jira/browse/DERBY-4845
>             Project: Derby
>          Issue Type: Bug
>          Components: Build tools
>    Affects Versions: 10.8.1.2
>            Reporter: Rick Hillegas
>         Attachments: check-build.ksh, d4845-buildbreak.diff, d4845-iapi-dependablefinder.diff,
d4845-iapi-nodefactory-getnode.diff, d4845-iapi-readOnlyUpgrade.diff, d4845-iapi-resultsetstatistics.diff,
d4845-iapi-slimmer-nodefactory.diff, d4845-iapi-statementnode.diff, d4845-iapi-unused-imports.diff,
derby-4845-01-aa-removeParserPrep, derby-4845-02-aa-flipUtilsAndTypes.diff, tools-i18n.diff
>
>
> Derby is supposed to have an incremental build. That is, if you change a file, then the
following command should recompile the file:
>    ant all
> There are several places in the graph of Derby build targets where this is not true.
If you change a file in certain packages, a subsequent "ant all" won't notice the change.
This issue is a place where we can track these bugs.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message