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 Libor Jelinek <lj...@virtage.com> on 2012/02/26 17:34:59 UTC

Is it necessary to send "shutdown" in JDBC URL for Network Server clients?

Hello everbody!
When running Derby Network Server scenario, is it neccessary for clients to
create connection with "shutdown" attribute when application is about to
terminate?

Or is enought to call java.sql.Connection.close() method? What is more
gracefully?

Thanks for all responses!
Libor

Re: Is it necessary to send "shutdown" in JDBC URL for Network Server clients?

Posted by Kristian Waagan <kr...@oracle.com>.
On 26.02.2012 17:34, Libor Jelinek wrote:
> Hello everbody!
> When running Derby Network Server scenario, is it neccessary for 
> clients to create connection with "shutdown" attribute when 
> application is about to terminate?
>
> Or is enought to call java.sql.Connection.close() method? What is more 
> gracefully?

Hi Libor,

Shutdown is an operation that affects all connections to the database, 
whereas Connection.close affects that connection only. If multiple 
clients are sharing a database, they would typically just close their 
connections.
If you know that the database won't be used any more / for a while, or 
the application about to terminate is the only client of the database, 
it is most graceful to shut down the database.

When a database is shut down Derby creates a database checkpoint and 
performs some other house-keeping tasks. If you don't shut down the 
database, Derby has to go through recovery on the next boot. Doing 
recovery is ok, but may cause the boot to take longer.

Note that shutting down a database doesn't shut down the network server, 
and further that stopping the network server doesn't trigger a clean 
shutdown of the databaes that are currently booted/active.


Regards,
-- 
Kristian

>
> Thanks for all responses!
> Libor