You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-user@db.apache.org by yves pielusenet <yv...@free.fr> on 2006/03/29 17:17:16 UTC

[SHUTDOWN] Should I shutdown embedded data base ?

Hello,
I'm newto Derby. My application connecte and create a database using
driver "org.apache.derby.jdbc.EmbeddedDriver" and url
"jdbc:derby:/my/path/to/database;create=True".
I do my inserts, commit and at the end I do myConnection.close().
All works fine :)
But I have just seen that there is a shutdown option. Should I use
this ?

thanks :)

--
Yves piel


Re: [SHUTDOWN] Should I shutdown embedded data base ?

Posted by yves pielusenet <yv...@free.fr>.
Le jeudi 30 mars 2006 à 10:55 +0200, Oystein Grovlen - Sun Norway a
écrit :
> yves pielusenet wrote:
> > Le jeudi 30 mars 2006 à 10:17 +0200, Oystein Grovlen - Sun Norway a
> > écrit :
> >> yves pielusenet wrote:
> >>
> >>> Thank you for your answer :)
> >>> So, since I use an embedded database, should I use the shutdown command
> >>> (database shutdown nor derby shutdown) everytime I do
> >>> Connection.close() ? (an if so, why derby connection close command call
> >>> itself database;shutdown=true commande ?)
> >>>
> >>> And a the very end of my application I do a derby shutdown
> >>> DriverManager.getConnection("jdbc:derby:cs;shutdown=true");
> >>>
> >>> that's right ? :)
> >> No, you need only shut down the database at the end of your application.
> >> Note that a derby shutdown is just a shutdown of all databases you have 
> >> opened.  If you just have a single database, a single shut down is enough.
> >>
> > 
> > So if I call shutdown a the very of the application I should use Derby
> > shutdown to close all database (even if there is only one) ?
> 
> Either database shutdown or derby shutdown will work.
> 
> > In fact, Derby shutdown do a checkpoint of all database that have been
> > opened during the JVM life. That's it ?
> 
> Yes.
> 
So I would do a Derby shutdown at he very end of my application :)
thank you very much !

--
yves piel


Re: [SHUTDOWN] Should I shutdown embedded data base ?

Posted by Oystein Grovlen - Sun Norway <Oy...@Sun.COM>.
yves pielusenet wrote:
> Le jeudi 30 mars 2006 à 10:17 +0200, Oystein Grovlen - Sun Norway a
> écrit :
>> yves pielusenet wrote:
>>
>>> Thank you for your answer :)
>>> So, since I use an embedded database, should I use the shutdown command
>>> (database shutdown nor derby shutdown) everytime I do
>>> Connection.close() ? (an if so, why derby connection close command call
>>> itself database;shutdown=true commande ?)
>>>
>>> And a the very end of my application I do a derby shutdown
>>> DriverManager.getConnection("jdbc:derby:cs;shutdown=true");
>>>
>>> that's right ? :)
>> No, you need only shut down the database at the end of your application.
>> Note that a derby shutdown is just a shutdown of all databases you have 
>> opened.  If you just have a single database, a single shut down is enough.
>>
> 
> So if I call shutdown a the very of the application I should use Derby
> shutdown to close all database (even if there is only one) ?

Either database shutdown or derby shutdown will work.

> In fact, Derby shutdown do a checkpoint of all database that have been
> opened during the JVM life. That's it ?

Yes.

-- 
Øystein Grøvlen, Senior Staff Engineer
Sun Microsystems, Database Technology Group
Trondheim, Norway

Re: [SHUTDOWN] Should I shutdown embedded data base ?

Posted by yves pielusenet <yv...@free.fr>.
Le jeudi 30 mars 2006 à 10:17 +0200, Oystein Grovlen - Sun Norway a
écrit :
> yves pielusenet wrote:
> 
> > Thank you for your answer :)
> > So, since I use an embedded database, should I use the shutdown command
> > (database shutdown nor derby shutdown) everytime I do
> > Connection.close() ? (an if so, why derby connection close command call
> > itself database;shutdown=true commande ?)
> > 
> > And a the very end of my application I do a derby shutdown
> > DriverManager.getConnection("jdbc:derby:cs;shutdown=true");
> > 
> > that's right ? :)
> 
> No, you need only shut down the database at the end of your application.
> Note that a derby shutdown is just a shutdown of all databases you have 
> opened.  If you just have a single database, a single shut down is enough.
> 

So if I call shutdown a the very of the application I should use Derby
shutdown to close all database (even if there is only one) ?
In fact, Derby shutdown do a checkpoint of all database that have been
opened during the JVM life. That's it ?


Re: [SHUTDOWN] Should I shutdown embedded data base ?

Posted by Oystein Grovlen - Sun Norway <Oy...@Sun.COM>.
yves pielusenet wrote:

> Thank you for your answer :)
> So, since I use an embedded database, should I use the shutdown command
> (database shutdown nor derby shutdown) everytime I do
> Connection.close() ? (an if so, why derby connection close command call
> itself database;shutdown=true commande ?)
> 
> And a the very end of my application I do a derby shutdown
> DriverManager.getConnection("jdbc:derby:cs;shutdown=true");
> 
> that's right ? :)

No, you need only shut down the database at the end of your application.
Note that a derby shutdown is just a shutdown of all databases you have 
opened.  If you just have a single database, a single shut down is enough.

-- 
Øystein Grøvlen, Senior Staff Engineer
Sun Microsystems, Database Technology Group
Trondheim, Norway

Re: [SHUTDOWN] Should I shutdown embedded data base ?

Posted by Daniel John Debrunner <dj...@apache.org>.
yves pielusenet wrote:


> So, since I use an embedded database, should I use the shutdown command
> (database shutdown nor derby shutdown) everytime I do
> Connection.close() ? (an if so, why derby connection close command call
> itself database;shutdown=true commande ?)

Connection.close doesn't close down the database because they may be
multiple connections open. Or the application may want to open another
connection after closing the previous one.

Dan.



Re: [SHUTDOWN] Should I shutdown embedded data base ?

Posted by yves pielusenet <yv...@free.fr>.
Le mercredi 29 mars 2006 à 09:35 -0800, Stanley Bradbury a écrit :
> yves pielusenet wrote:
> 
> >Hello,
> >I'm newto Derby. My application connecte and create a database using
> >driver "org.apache.derby.jdbc.EmbeddedDriver" and url
> >"jdbc:derby:/my/path/to/database;create=True".
> >I do my inserts, commit and at the end I do myConnection.close().
> >All works fine :)
> >But I have just seen that there is a shutdown option. Should I use
> >this ?
> >
> >thanks :)
> >
> >--
> >Yves piel
> >
> >
> >  
> >
> Yes.  Shutting down the database insures that all transactions are 
> completed and puts a CHECKPOINT record in the transaction log that 
> allows a quicker startup when the database is booted next (Derby will 
> know that no rollback recovery is needed).
> 
> 
> 

Thank you for your answer :)
So, since I use an embedded database, should I use the shutdown command
(database shutdown nor derby shutdown) everytime I do
Connection.close() ? (an if so, why derby connection close command call
itself database;shutdown=true commande ?)

And a the very end of my application I do a derby shutdown
DriverManager.getConnection("jdbc:derby:cs;shutdown=true");

that's right ? :)

--
Yves piel


Re: [SHUTDOWN] Should I shutdown embedded data base ?

Posted by Stanley Bradbury <St...@gmail.com>.
yves pielusenet wrote:

>Hello,
>I'm newto Derby. My application connecte and create a database using
>driver "org.apache.derby.jdbc.EmbeddedDriver" and url
>"jdbc:derby:/my/path/to/database;create=True".
>I do my inserts, commit and at the end I do myConnection.close().
>All works fine :)
>But I have just seen that there is a shutdown option. Should I use
>this ?
>
>thanks :)
>
>--
>Yves piel
>
>
>  
>
Yes.  Shutting down the database insures that all transactions are 
completed and puts a CHECKPOINT record in the transaction log that 
allows a quicker startup when the database is booted next (Derby will 
know that no rollback recovery is needed).