× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Our application uses the Runtime.addShutdownHook() method to trap end
requests.  On Windows this means that if you close the console window
the application has a chance to end gracefully; similarly on Unix if you
issue a kill command.

The corresponding event on OS/400 is ENDJOB, right?  So you'd expect the
shutdown hook code to be executed when an ENDJOB is executed against the
job that issues the java command.  But it doesn't happen.  In case there
was a timing problem I tried using *CNTRLD and DLYTIME(1200).  Twenty
minutes ought to be enough for any self-respecting JVM to finish.  But
the threads don't output the expected "I'm ending" messages; and most
significantly, the job is still reported as ending abnormally.

Is there a way to make this work?  We're submitting a batch job which
calls QSH with some parameters, including a script file which is
executed.  The shell script executes the java command.

As I type this I begin to suspect that we'll have to end the BCI or
prestart job that the QSH command communicates with, because that's
where the java command is running.

The java code with the shutdown hook looks like this:


        // Register a shutdown hook that will stop the server gracefully
if its process is
        // killed by the operating system.
        Runtime.getRuntime().addShutdownHook(new Thread()
            {
                public void run()
                {
                    theServer.closedown("by signal", null, false);
                }
            });

The object theServer is a singleton, and the closedown() method tells
all its threads to end.

Any ideas?  I should note that I can't find any iSeries-specific
comments on this on IBM's website or anywhere else, but AlphaWorks has
some two-year old comments saying it doesn't work on Linux.

TIA.

Cheers,

Martin.

--
Martin McCallion
Senior Technical Consultant
Work:  martin.mccallion@misys.com
Home: martin.mccallion@ukonline.co.uk
Misys International Banking Systems
1 St George's Road, London, SW19 4DR, UK
T +44 (0)20 8486 1951
F +44 (0) 20 8947 3373
www.misys.com
This email message is intended for the named recipient only. It may be
privileged and/or confidential. If you are not the  intended named
recipient of this email then you should not  copy it or use it for any
purpose, nor disclose its contents to any other person. You should
contact Misys International Banking Systems as shown below so that we
can take appropriate action at no cost to yourself.
Misys International Banking Systems Ltd,1 St
George's Road, London, SW19 4DR, UK. Email: ibs.postmaster@misys.com.
Tel: +44 (0) 20 8879 1188 Fax: +44 (0) 20 8947 3373
Misys International Banking Systems Ltd is
registered in England and Wales under company no. 971479


As an Amazon Associate we earn from qualifying purchases.

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.