Re: Prevent JVM from starting again and again
Madie <[email protected]>
| Newsgroups | gmane.comp.lang.as400.java |
|---|---|
| Message-ID | <CAFW2iBDaNmPKBUKCvq5yyUGU1bMqhLyseVimC_Z0+vMBtGe0ZQ@mail.gmail.com> |
Thanks for the replies... QIBM_QSH_CMD_OUTPUT surely does help... i am not sure but I think I used it in past and I just forgot about it .... anyways, I tried remodel my program so I am using a driver RPGLE reading a data queue and then this RPGLE will call CL which in turn is calling QSH command... seems its starting the JVM each and every time... comparing its performance from interactive call of CL , I do not think its any benefit in terms of performance.... any ideas if I call the Java class from driver RPGLE will it help get any performance benefit? On Tue, Sep 4, 2018 at 3:25 AM, <[email protected]> wrote: > Had the same problem here that the JVM is starting with every time I call > the command (its not really a problem because that is what is supposed to > happen: you call the program, the JVM starts, executes your program and > once its done, quits the VM again). > > My “fix” for this problem was to change my program to start up once and > then scan a folder for a txt file that contains all the parameters that > would usually be handed over to the program. Once it detects a text file, > it opens a new thread to process it and once done, the thread is closed but > the program itself keeps running. This way it can also handle multiple > requests in parallel. The text file is created by the CL that would have > usually called my program before the fix. > > I assume the correct solution would be to set something up like an > application server that runs your application and is then called by the CL > but no clue if that is > > a) the correct approach and > b) how to do that ;) > > Hope that helps! > > Max > -- > This is the Java Programming on and around the IBM i (JAVA400-L) mailing > list > To post a message email: [email protected] > To subscribe, unsubscribe, or change list options, > visit: https://lists.midrange.com/mailman/listinfo/java400-l > or email: [email protected] > Before posting, please take a moment to review the archives > at https://archive.midrange.com/java400-l. > > -- This is the Java Programming on and around the IBM i (JAVA400-L) mailing list To post a message email: [email protected] To subscribe, unsubscribe, or change list options, visit: https://lists.midrange.com/mailman/listinfo/java400-l or email: [email protected] Before posting, please take a moment to review the archives at https://archive.midrange.com/java400-l.