Issue Details (XML | Word | Printable)

Key: DERBY-51
Type: Improvement Improvement
Status: Open Open
Priority: Major Major
Assignee: Unassigned
Reporter: Kathey Marsden
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Derby

Need NetworkServerControl shutdown API method that does not shutdown derby embedded

Created: 27/Oct/04 04:47 PM   Updated: 19/Apr/06 03:33 PM
Return to search
Component/s: Network Server
Affects Version/s: 10.0.2.0
Fix Version/s: None

Time Tracking:
Not Specified

File Attachments:
  Size
Java Source File NSinSameJVM.java 2005-05-19 06:05 AM David Van Couvering 4 kB


 Description  « Hide
In an applcation server environment where both Network Server
and Embedded connections are being used it is a problem when
Network server is shutdown and deregisters the embedded driver
and shutsdown the databases.


this would be the signature
/**
* Shutdown a Network Server.
* Shuts down the Network Server listening on the port and InetAddress
* specified in the constructor for this NetworkServerControl object.
*
* @param derbyShutdown if true, shutsdown the derby embedded system . if false do not shutdown derby embeddded system
* @exception Exception throws an exception if an error occurs
*/
public void shutdown(boolean derbyShutdown) throws Exception


 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
David Van Couvering added a comment - 19/May/05 06:03 AM
I can't seem to reproduce this behavior (see attached modification to the test derbynet/NSInSameJVM.java). I also looked in the code for NetworkServerControlImpl, and the code that shuts down embedded seems to be commented out -- see the commented out code at the end of NetworkServerControlImpl.blockingStart(), starting with "// Shutdown Cloudscape".

So, unless I missed something, it appears that right now the Derby system does *not* get shut down when the Network Server is stopped.

Is it that we need an API that makes this an optional behavior? Or are things OK as they stand?


David Van Couvering added a comment - 19/May/05 06:05 AM
This modification to NSinSameJVM.java ensures that an embedded connection is usable after
shutdown of the Network Server. Running the test produced no failures...

Kathey Marsden added a comment - 04/Feb/06 07:52 AM
Well I guess I didn't notice David's comment on this issue when he made it (in May).

David said
>code that shuts down embedded seems to be commented out -- see the commented out code at the end of >NetworkServerControlImpl.blockingStart(), starting with "// Shutdown Cloudscape".

I am a little surprised and wonder.
Has it always been this way since 10.0?
Are we shutting down cleanly when we start from the command line?

>Is it that we need an API that makes this an optional behavior? Or are things OK as they stand?
I tend to think we need an api to shutdown embedded with network server. Othewise it seems likely that folks will assume it gets shutdown.


Kathey Marsden added a comment - 19/Apr/06 06:53 AM
After some discussion on this issue and a bit of minimal testing I think that the following situation exists. The default shutdown API and command line shutdown is not shutting down the embedded database and so this particular issue which prompted this request does not exist. I don't think the default behaviour for the API shutdown can be changed at this point.

 So I suggest we do the following:

1) Close this issue as invalid
2) Open a new issue to add an API public void shutdown(boolean derbyShutdown)
3) Make it clear in the javadoc that public void shutdown() does not shutdown Derby (calls shutdown(false))


Also we can file a bug that the NetworkServerControl command line shutdown should shutdown embedded if the server was started from the command line. I think it is safe to shutdown in this case and maybe for any command line shutdown.

Does this should reasonable?




John H. Embretsen added a comment - 19/Apr/06 03:33 PM
Kathey Marsden commented:

> I don't think the default behaviour for the API shutdown can be changed at this point.

Why is that?

> So I suggest we do the following:
>
> 1) Close this issue as invalid
> 2) Open a new issue to add an API public void shutdown(boolean derbyShutdown)
> 3) Make it clear in the javadoc that public void shutdown() does not shutdown Derby (calls shutdown(false))

If we don't change the default API behavior then we also need to do

4) Correct the manuals.

Specifically, I found the following statement in the admin guide, http://db.apache.org/derby/docs/dev/adminguide/tadminconfigshuttingdownthenetworkserver.html, for trunk:

<quote>
If user authentication is disabled, a Derby database will shut down normally when the Network Server is shut down. If user authentication is enabled, you must explicitly shut down the database before shutting down the Network Server by specifying a valid Derby user name and password.
</quote>