You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-user@db.apache.org by Yoel Spotts <YS...@nexidia.com> on 2013/09/04 19:27:27 UTC

Network Server startup and shutdown

I am starting a network server in addition to an embedded server. I'd like to do this programmatically, by calling

NetworkServerControl server = new NetworkServerControl();
server.start (null);

as described here: http://docs.oracle.com/javadb/10.5.1.1/adminguide/tadminconfig814963.html

My question is: should I start the network server first or the embedded server?

And when shutting down, which one should I shutdown first?

Thanks!

Yoel Spotts


Re: Network Server startup and shutdown

Posted by Rick Hillegas <ri...@oracle.com>.
On 9/9/13 7:05 AM, Yoel Spotts wrote:
> Rick,
>
> Thanks for the quick response and help. If that is the case (i.e. there is a race condition possibility), why would you recommend shutting down the engine first?
Hi Yoel,

You can do it either way. Bringing down the engine first minimizes the 
risk that your application will exit without gracefully parking the 
engine. But if you need to handle the race condition, then bring down 
the server first.

Regards,
-Rick
> Yoel
>
> -----Original Message-----
> From: Rick Hillegas [mailto:rick.hillegas@oracle.com]
> Sent: Monday, September 09, 2013 10:02 AM
> To: derby-user@db.apache.org
> Subject: Re: Network Server startup and shutdown
>
> On 9/9/13 6:56 AM, Yoel Spotts wrote:
>> Rick,
>>
>> Interesting. Thanks for the info.
>>
>> Can you help me understand this a little better: if I shutdown the engine (by calling DriverManager.getConnection("jdbc:derby:;shutdown=true")), won't the network service be "orphaned" (i.e. a network service without an underlying engine -- even if for a only a short period of time)?
> Yes, that's true. If you are worried about that race condition, you can bring the server down first and then the engine.
>
> Hope that's more useful for you,
> -Rick
>> Thanks
>>
>> Yoel
>>
>> -----Original Message-----
>> From: Rick Hillegas [mailto:rick.hillegas@oracle.com]
>> Sent: Monday, September 09, 2013 9:43 AM
>> To: derby-user@db.apache.org
>> Subject: Re: Network Server startup and shutdown
>>
>> On 9/4/13 10:27 AM, Yoel Spotts wrote:
>>> I am starting a network server in addition to an embedded server. I'd
>>> like to do this programmatically, by calling
>>>
>>> NetworkServerControl server = new NetworkServerControl();
>>>
>>> server.start (null);
>>>
>>> as described here:
>>> http://docs.oracle.com/javadb/10.5.1.1/adminguide/tadminconfig814963.
>>> h
>>> tml
>>>
>>> My question is: should I start the network server first or the
>>> embedded server?
>>>
>> Hi Yoel,
>>
>> This can be a little puzzling for people who are familiar with non-embedded databases. I think what you mean is the network server and the embedded engine. There is no such thing as an embedded server. The network server boots the derby engine as needed. You don't need to boot the engine.
>>> And when shutting down, which one should I shutdown first?
>>>
>> I would recommend bringing down the engine first and then the server.
>>
>> Hope this helps,
>> -Rick
>>> Thanks!
>>>
>>> Yoel Spotts
>>>
>


RE: Network Server startup and shutdown

Posted by Yoel Spotts <YS...@nexidia.com>.
Rick,

Thanks for the quick response and help. If that is the case (i.e. there is a race condition possibility), why would you recommend shutting down the engine first?

Yoel

-----Original Message-----
From: Rick Hillegas [mailto:rick.hillegas@oracle.com] 
Sent: Monday, September 09, 2013 10:02 AM
To: derby-user@db.apache.org
Subject: Re: Network Server startup and shutdown

On 9/9/13 6:56 AM, Yoel Spotts wrote:
> Rick,
>
> Interesting. Thanks for the info.
>
> Can you help me understand this a little better: if I shutdown the engine (by calling DriverManager.getConnection("jdbc:derby:;shutdown=true")), won't the network service be "orphaned" (i.e. a network service without an underlying engine -- even if for a only a short period of time)?
Yes, that's true. If you are worried about that race condition, you can bring the server down first and then the engine.

Hope that's more useful for you,
-Rick
> Thanks
>
> Yoel
>
> -----Original Message-----
> From: Rick Hillegas [mailto:rick.hillegas@oracle.com]
> Sent: Monday, September 09, 2013 9:43 AM
> To: derby-user@db.apache.org
> Subject: Re: Network Server startup and shutdown
>
> On 9/4/13 10:27 AM, Yoel Spotts wrote:
>> I am starting a network server in addition to an embedded server. I'd 
>> like to do this programmatically, by calling
>>
>> NetworkServerControl server = new NetworkServerControl();
>>
>> server.start (null);
>>
>> as described here:
>> http://docs.oracle.com/javadb/10.5.1.1/adminguide/tadminconfig814963.
>> h
>> tml
>>
>> My question is: should I start the network server first or the 
>> embedded server?
>>
> Hi Yoel,
>
> This can be a little puzzling for people who are familiar with non-embedded databases. I think what you mean is the network server and the embedded engine. There is no such thing as an embedded server. The network server boots the derby engine as needed. You don't need to boot the engine.
>> And when shutting down, which one should I shutdown first?
>>
> I would recommend bringing down the engine first and then the server.
>
> Hope this helps,
> -Rick
>> Thanks!
>>
>> Yoel Spotts
>>
>


Re: Network Server startup and shutdown

Posted by Rick Hillegas <ri...@oracle.com>.
On 9/9/13 6:56 AM, Yoel Spotts wrote:
> Rick,
>
> Interesting. Thanks for the info.
>
> Can you help me understand this a little better: if I shutdown the engine (by calling DriverManager.getConnection("jdbc:derby:;shutdown=true")), won't the network service be "orphaned" (i.e. a network service without an underlying engine -- even if for a only a short period of time)?
Yes, that's true. If you are worried about that race condition, you can 
bring the server down first and then the engine.

Hope that's more useful for you,
-Rick
> Thanks
>
> Yoel
>
> -----Original Message-----
> From: Rick Hillegas [mailto:rick.hillegas@oracle.com]
> Sent: Monday, September 09, 2013 9:43 AM
> To: derby-user@db.apache.org
> Subject: Re: Network Server startup and shutdown
>
> On 9/4/13 10:27 AM, Yoel Spotts wrote:
>> I am starting a network server in addition to an embedded server. I'd
>> like to do this programmatically, by calling
>>
>> NetworkServerControl server = new NetworkServerControl();
>>
>> server.start (null);
>>
>> as described here:
>> http://docs.oracle.com/javadb/10.5.1.1/adminguide/tadminconfig814963.h
>> tml
>>
>> My question is: should I start the network server first or the
>> embedded server?
>>
> Hi Yoel,
>
> This can be a little puzzling for people who are familiar with non-embedded databases. I think what you mean is the network server and the embedded engine. There is no such thing as an embedded server. The network server boots the derby engine as needed. You don't need to boot the engine.
>> And when shutting down, which one should I shutdown first?
>>
> I would recommend bringing down the engine first and then the server.
>
> Hope this helps,
> -Rick
>> Thanks!
>>
>> Yoel Spotts
>>
>


RE: Network Server startup and shutdown

Posted by Yoel Spotts <YS...@nexidia.com>.
Rick,

Interesting. Thanks for the info. 

Can you help me understand this a little better: if I shutdown the engine (by calling DriverManager.getConnection("jdbc:derby:;shutdown=true")), won't the network service be "orphaned" (i.e. a network service without an underlying engine -- even if for a only a short period of time)?

Thanks

Yoel

-----Original Message-----
From: Rick Hillegas [mailto:rick.hillegas@oracle.com] 
Sent: Monday, September 09, 2013 9:43 AM
To: derby-user@db.apache.org
Subject: Re: Network Server startup and shutdown

On 9/4/13 10:27 AM, Yoel Spotts wrote:
>
> I am starting a network server in addition to an embedded server. I'd 
> like to do this programmatically, by calling
>
> NetworkServerControl server = new NetworkServerControl();
>
> server.start (null);
>
> as described here: 
> http://docs.oracle.com/javadb/10.5.1.1/adminguide/tadminconfig814963.h
> tml
>
> My question is: should I start the network server first or the 
> embedded server?
>
Hi Yoel,

This can be a little puzzling for people who are familiar with non-embedded databases. I think what you mean is the network server and the embedded engine. There is no such thing as an embedded server. The network server boots the derby engine as needed. You don't need to boot the engine.
>
> And when shutting down, which one should I shutdown first?
>
I would recommend bringing down the engine first and then the server.

Hope this helps,
-Rick
>
> Thanks!
>
> Yoel Spotts
>


Re: Network Server startup and shutdown

Posted by Rick Hillegas <ri...@oracle.com>.
On 9/4/13 10:27 AM, Yoel Spotts wrote:
>
> I am starting a network server in addition to an embedded server. I’d 
> like to do this programmatically, by calling
>
> NetworkServerControl server = new NetworkServerControl();
>
> server.start (null);
>
> as described here: 
> http://docs.oracle.com/javadb/10.5.1.1/adminguide/tadminconfig814963.html
>
> My question is: should I start the network server first or the 
> embedded server?
>
Hi Yoel,

This can be a little puzzling for people who are familiar with 
non-embedded databases. I think what you mean is the network server and 
the embedded engine. There is no such thing as an embedded server. The 
network server boots the derby engine as needed. You don't need to boot 
the engine.
>
> And when shutting down, which one should I shutdown first?
>
I would recommend bringing down the engine first and then the server.

Hope this helps,
-Rick
>
> Thanks!
>
> Yoel Spotts
>