Ahhh !
ds.setShutdownDatabase( "shutdown" );
conn = ds.getConnection("user1", "user1");
this will cause the database to shutdown when a java.sql.Connection
object is obtained from the data source.
Sorry for the noise.
-Steve More
On 1/5/07, Stephen More <[EMAIL PROTECTED]> wrote:
On 1/5/07, Myrna van Lunteren <[EMAIL PROTECTED]> wrote:
> On 1/5/07, Stephen More <[EMAIL PROTECTED]> wrote:
> > On 1/4/07, Daniel John Debrunner <[EMAIL PROTECTED]> wrote:
> > I would like to suggest that this type of connection get added to the
> > demo SimpleApp.java.
> >
> > If I created a patch, would someone be willing to add it ?
>
> Thx for offering to make a patch.
> I'll volunteer to shepherd such a patch in, if no one else does. :-)
>
Great. I have made some changes and have been testing.
The first time I run it, everything seems to work fine.
If I try to run it a second time, I get
WARNING: Derby (instance c013800d-010f-eaef-0fe9-00000010e7f8) is
attempting to boot the database /home/mores/test/java/derbyDB even
though Derby (instance c013800d-010f-eaee-a71c-000000106798) may still
be active. Only one instance of Derby should boot a database at a
time. Severe and non-recoverable corruption can result and may have
already occurred.
I tried:
System.out.println( "Sending the shutdown command" );
ds.setShutdownDatabase( "shutdown" );
try
{
Thread.sleep( 3000 );
} catch (InterruptedException e)
{
}
System.out.println( "is it down" );
But that does not seem to work.
What is the right way to shut it down ?
-Thanks
Steve More