db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kristian Waagan <kristian.waa...@oracle.com>
Subject Re: Is it necessary to send "shutdown" in JDBC URL for Network Server clients?
Date Mon, 27 Feb 2012 06:12:05 GMT
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


Mime
View raw message