db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From John Embretsen <John.Embret...@Sun.COM>
Subject Re: [jira] Commented: (DERBY-1293) Derby Server and Administration Guide - derby.drda.startNetworkServer
Date Tue, 09 May 2006 10:11:44 GMT
Halley Pacheco de Oliveira (JIRA) wrote:

>     [ http://issues.apache.org/jira/browse/DERBY-1293?page=comments#action_12378433 ]

> Halley Pacheco de Oliveira commented on DERBY-1293:
> ---------------------------------------------------
> The point I would like to emphasize is that the Network Server is linked to the application.

So by "the application" you mean some Java application that is embedding
the Derby Network Server, right? (since you are mentioning loading the
embedded driver next)

> When the application starts (embedded driver is loaded), the Network Server starts, and
when the application ends, the Network Server ends, but it only happens if the Network Server
was not started before starting the application.

I still think we should treat starting and stopping the server
separately, or it will quickly become confusing and complicated. Yes,
the server will only be started if it was not already started before
starting the embedding application - that is obvious. And yes, the
server will probably not be stopped when the embedding application ends
if that particular application did not start the server in the first
place - that is less obvious, so I agree that it could be mentioned

However, this is already covered by the following statement under
"Static or dynamic" on the manual page in question:

"You must shut down the Network Server and restart Derby for this change
to take effect."

> People like me that all their lives used DB2, Oracle, SQL Server or even PostgreSQL are
not used to this behavior. When one of these servers is started, it continues running after
the application ends, and usually they start when the operating system boots. 

Hmm, ok, I understand. But Derby is pure Java, and Java programs do not
live longer than the JVM in which they run. When you embed a network
server in your Java application, it should not come as a surprise that
the server will stop when your application ends. A stand-alone network
server may be something else, but that is not what we are discussing
here. Anyway, I think we don't really disagree much here, so we should
be able to come up with a result we're all happy with pretty soon :)

By the way, I believe someone on derby-user has expressed a need to run
the Derby Network Server as a service in the OS, but I don't remember
the result of that inquiry.

> This dependency between the Network Server and an application is not natural for me,
and in this case we are talking about a Network Server, not about an embedded server.

I am (and have been) talking about the Network Server as an embedded
server, since we are discussing the manual page for the
derby.drda.startNetworkServer property. I think we should limit this
discussion to that particular scenario.

Here is what I suggest:

== START ==

Use the derby.drda.startNetworkServer property to simplify embedding the
Network Server in your Java application.

When you set derby.drda.startNetworkServer to true, the Network Server
will automatically start when you start Derby (in this context, Derby
will start when the embedded driver is loaded). Only one Network Server
can be started in a JVM.

Please be aware that if the Network Server is started using this
property, the Network Server will stop when your application ends or
when you stop it by other means (e.g. by using the Java API or the
command line interface, or by shutting down the Derby system), whichever
comes first.

== END ==

Does this capture the points you wanted to make, Halley? I tried to keep
it as simple as possible...

I think the point that "It will only start if it has not already been
started by other means" is covered by the "Static or Dynamic" statement
at the bottom of the page.


View raw message