db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andrew McIntyre" <mcintyr...@gmail.com>
Subject Re: Accessing embedded Derby in forked Maven2 build
Date Mon, 13 Mar 2006 21:24:18 GMT
On 3/13/06, Randy Watler <watler@wispertel.net> wrote:
> Andrew,
> Thanks for the speedy reply. Let me give this a try.
> To be honest, I am confused about the use of the fork="true" attribute
> in the <java> task. Can shutdown=true be invoked from another JVM
> instance like this and have it release the lock that the parent JVM is
> holding?
> Randy

I had to fork the VM because I wanted the task to run in a specific
location relative to the basedir of the Ant project, which requires
that fork be set to true. This assumed that another instance of the
engine wasn't running, just that Derby wasn't shutdown cleanly when
the previous JVM connected to Derby and did its work. The reason for
that is that the same scripts are used to test the build of the
database, and shutting down Derby from inside the scripts which load
the tables would prevent the test from completing.

It sounds like you're setting up a test database using Ant's <sql>
commands and this leaves the Derby engine running in the same VM as
Ant. So, my original solution wouldn't work, as ij wouldn't be able to
connect. It sounds like you may need to move the creation of the test
database into another VM. You could do this by putting all of the SQL
you have in your Ant <sql> statements into a file and running it in a
forked JVM using ij.


View raw message