db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Knut Anders Hatlen <knut.hat...@oracle.com>
Subject Re: Is there some way to shut down a Derby database faster?
Date Thu, 04 Jul 2013 07:10:18 GMT
Trejkaz <trejkaz@trypticon.org> writes:

> On Tue, Jul 2, 2013 at 10:18 PM, Rick Hillegas <rick.hillegas@oracle.com> wrote:
>> If you simply exit the VM without requesting an orderly shutdown, then the
>> checkpoint won't be performed. However, the cleanup performed by that
>> checkpoint still has to be performed. It will be performed the next time you
>> boot the database. My experience is that if you always skip the orderly
>> shutdown, then the time required to boot the database grows progressively
>> longer until it is intolerable. Full disclosure: I haven't tried this
>> experiment for a long time and there may have been improvements in this
>> area. Nevertheless, orderly shutdown is the recommended practice.
> Exiting the VM isn't really an option for me anyway, this is just when
> someone is closing the database, potentially planning to open another
> one.
> Another question along the same lines then - if I kick off the
> shutdown in another thread, what happens if the same database is then
> reopened while the shutdown is still occurring?

Hi Trejkaz,

I think the shutdown will continue unaffected of the other thread trying
to reopen the database. The thread that tries to reopen it, on the other
hand, might see all kinds of errors, like NullPointerExceptions or
conglomerate not found errors.

There once was an effort to make Derby more well-behaved in this use
case (see https://issues.apache.org/jira/browse/DERBY-4447), but the
work on that issue stalled. So for now you'll probably have to
synchronize between the thread that shuts down the database and those
that try to connect to the same database, so that they wait with
connecting until the database has finished shutting down.

Knut Anders

View raw message