Shutting down eXist

View: New views
2 Messages — Rating Filter:   Alert me  

Shutting down eXist

by Jason Smith-11 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Some parts of this message have been removed. Learn more about Nabble's security policy.
I am wondering if anyone knows a good strategy for shutting down eXist automatically when run as a service. 
 
I am running as a WAR in Tomcat (standalone, of course).  Using Tanuki JavaServiceWrapper. 
 
I'd like to be able to call the shutdown command when someone stops the service.  Otherwise I might have to use a special script to shut down my services in order (can't just shut down the server), or I guess take your chances with data corruption (not that it happens often enough to quantify).
 

Jason Smith
Software Engineer

InfoTrust Group, Inc.

500 Discovery Parkway, Suite 200
Superior, CO 80027
Office 303-627-6571
Fax 303-666-6711

Email jsmith@...

WEB www.infotrustgroup.com

This e-mail and all information included herein do not constitute a legal agreement accorded by INFOTRUST GROUP and its affiliates and subsidiaries.  All legal agreements must be formulated in writing by a legal representative of INFOTRUST GROUP. This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed.  If you have received this e-mail by mistake, please inform us and destroy this e-mail and any documents it might contain.  Please note that any views or opinions presented in this email are solely those of the author and do not necessarily represent those of the company. Finally, the recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email.  Thank you for your cooperation.


------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Exist-open mailing list
Exist-open@...
https://lists.sourceforge.net/lists/listinfo/exist-open

Re: Shutting down eXist

by Wolfgang Meier-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

> I am wondering if anyone knows a good strategy for shutting down eXist
> automatically when run as a service.
>
> I am running as a WAR in Tomcat (standalone, of course).  Using Tanuki
> JavaServiceWrapper.

You should at least check the various timeout settings supported by
JavaServiceWrapper. We had some problems in the past with the wrapper
killing the JVM too early. When eXist receives a shutdown signal or
request, it will wait for writing transactions to complete. This can
take a few minutes, e.g. if a large document is being stored.

The best solution is to write your own WrapperListener (see
tools/wrapper/src/org/exist/wrapper/Main, which usually calls
org.exist.JettyStart), which would then launch Tomcat and register
shutdown hooks. The central eXist method to call for shutdown is
BrokerPool.stopAll(false).

eXist 1.2.6 and 1.4 also provide a callback mechanism, which can be
used to inform the wrapper that the database is still starting up or
shutting down. Just register an Observer with

BrokerPool.registerStatusObserver(observer);

This will effectively prevent the wrapper from killing the database as
long as it is still alive. org.exist.wrapper.Main implements the
Observer with

public void update(Observable o, Object arg) {
        if ("startup".equals(arg))
            WrapperManager.signalStarting(60000);
        else
            WrapperManager.signalStopping(60000);
    }

Wolfgang

------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Exist-open mailing list
Exist-open@...
https://lists.sourceforge.net/lists/listinfo/exist-open