db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Stephen More" <stephen.m...@gmail.com>
Subject Re: Help getting started with j9 and derby
Date Fri, 05 Jan 2007 17:53:17 GMT
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 <stephen.more@gmail.com> wrote:
> On 1/5/07, Myrna van Lunteren <m.v.lunteren@gmail.com> wrote:
> > On 1/5/07, Stephen More <stephen.more@gmail.com> wrote:
> > > On 1/4/07, Daniel John Debrunner <djd@apache.org> 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
>

Mime
View raw message