You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-dev@db.apache.org by Bryan Pendleton <bp...@amberpoint.com> on 2006/03/30 18:50:16 UTC
[Fwd: Re: [SHUTDOWN] Should I shutdown embedded data base ?]
Moving this discussion to Derby-Dev because I want to ask a code-related
question to Oystein:
Have you had a chance to look at http://issues.apache.org/jira/browse/DERBY-51
Your comments seem to relate to a number of the issues raised in this bug.
In particular, I am trying to understand the differences, *in the Network
Server Environment*, between:
- Shutting down a single database that is being served by the Network Server
- Shutting down all the databases that the NS is serving, but leaving the
NS itself up and running
- Shutting down the Network Server itself, either
- with, or
- without shutting down the databases it is serving
I've only looked at this a little bit, and have made myself thoroughly
confused, so I was hoping that maybe you could shed some light in this area.
thanks,
bryan
-------- Original Message --------
Subject: Re: [SHUTDOWN] Should I shutdown embedded data base ?
From: Oystein Grovlen - Sun Norway <Oy...@Sun.COM>
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: [Fwd: Re: [SHUTDOWN] Should I shutdown embedded data base ?]
Posted by Bryan Pendleton <bp...@amberpoint.com>.
Stanley Bradbury wrote:
> I believe (Oystein or someone in the code can you confirm this) that
> when Network Server is shutdown it basically performs the form 2 (ALL)
> shutdown of Derby before exiting (if it does not then a bug needs to be
> filed).
Right, this is the essence of my question. I think that this is the
issue that DERBY-51 is tracking: http://issues.apache.org/jira/browse/DERBY-51
Several of us have read the code for Network Server shutdown, and it appears
to *not* be shutting down the databases right now.
But it's confusing, and I think more eyes are needed, so your help with
the experimentation and discussion is greatly appreciated here!
For example, your observation that the database lock file seems to stick
around would appear to be further evidence that NS shutdown is *not* shutting
down the database(s) properly.
thanks,
bryan
Re: [Fwd: Re: [SHUTDOWN] Should I shutdown embedded data base ?]
Posted by Stanley Bradbury <St...@gmail.com>.
Bryan Pendleton wrote:
> Moving this discussion to Derby-Dev because I want to ask a code-related
> question to Oystein:
>
> Have you had a chance to look at
> http://issues.apache.org/jira/browse/DERBY-51
>
> Your comments seem to relate to a number of the issues raised in this
> bug.
>
> In particular, I am trying to understand the differences, *in the Network
> Server Environment*, between:
> - Shutting down a single database that is being served by the Network
> Server
> - Shutting down all the databases that the NS is serving, but leaving
> the
> NS itself up and running
> - Shutting down the Network Server itself, either
> - with, or
> - without shutting down the databases it is serving
>
> I've only looked at this a little bit, and have made myself thoroughly
> confused, so I was hoping that maybe you could shed some light in this
> area.
>
> thanks,
>
> bryan
>
>
> -------- Original Message --------
> Subject: Re: [SHUTDOWN] Should I shutdown embedded data base ?
> From: Oystein Grovlen - Sun Norway <Oy...@Sun.COM>
>
> 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.
>
Hi -
There are two forms of shutdown and this is how it has been explained to me:
1) Used with a URL specifying a database name
(jdbc:derby:myDB;shutdown=true) shuts down THE database specified by
closing out all transactions, flushing the buffers to disk,
checkpointing the transaction log and removing the db.lck file. NOTE:
it leaves the Derby engine running within the JVM
2) Use without a database name (jdbc:derby:;shutdown=true) shuts down
ALL database that were booted (doing all the above things for each) then
shutsdown the Derby engine it self (I believe this means unloading the
driver but Oystein will know for sure).
I believe (Oystein or someone in the code can you confirm this) that
when Network Server is shutdown it basically performs the form 2 (ALL)
shutdown of Derby before exiting (if it does not then a bug needs to be
filed). Unless there are specific reasons to do otherwise it is best
NOT to shutdown datbases from the application but to let them be
shutdown when the Server is shutdown.
The reason is that there is no way to tell if someone else is also
connected to the DB. If they are and you shutdown the DB the next query
they make will fail cause the DB is gone. We need to play nicely in a
shared environment.
I think this addresses the situations you describe. I have noted that
no database shutdown messages are writen to the log when the databases
are shutdown along with Network Server and the db.lck file still exists
afterwards so this process could use improvement.