× 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.



Patrick,

With the JVM startup sometimes taking a lot of time (especially on an
underpowered machine) I can understand that you want to keep the Java
program running. Here's what I did when I encountered this:

I wrote a Java program that would extract data from a set of files and store
the result in a file on the IFS. The user would pass a SQL statement that
determines what data should be extracted and a bunch of other parameters.
This program was developed for 5250 users, so I also wrote a CL that calls
the java program as well as a command so that the user can prompt for
parameters. When the users started using it they complained about the time
it takes to run the command.

What I did was change the Java program to get it's parameters from a data
queue. The Java program was configured to always run and all it did was wait
for data on the data queue. The CL would then place parameters on the data
queue, the Java program would read it, complete the processing and place the
results on another data queue that is keyed (job number of the CL is used as
the key). This did away with the long startup time and the users were happy.
This program did not need to process concurrent requests because it's actual
processing did not take a long time. If you need to process many concurrent
requests then you can either create many worker threads that all listen on
the same data queue or you can run many instances of the java application
that all listen on the same data queue.

I hope this gives you a few ideas.

Etienne

-----Original Message-----
From: David Morris [mailto:David.Morris@plumcreek.com]
Sent: Monday, January 21, 2002 5:42 PM
To: java400-l@midrange.com
Subject: Re: keep a java program open


Patrick,

If you are using the 1.3 JDK, it seems like you could keep a
thread alive that just waits on a Timer event. First you set up
a class that creates a new Timer. You can then use the
schedule method to run tasks. Those tasks should extend the
TimerTask class.

David Morris

>>> Patrick.F.O'Dowd@gsk.com 01/21/02 01:49PM >>>
Hi,
Is it possible to keep a java program resident in memory preventing a
new
process being fired up everytime the RUNJVA command is called on the
program?  This would be similar to having an RPG program that does not
seton LR.
I am finding the first call to a java program on the AS400 is very
slow,
but once the program is up and running performance is fine.

Thanks,
Pat O'Dowd
_______________________________________________
This is the Java Programming on and around the iSeries / AS400 (JAVA400-L)
mailing list
To post a message email: JAVA400-L@midrange.com
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/cgi-bin/listinfo/java400-l
or email: JAVA400-L-request@midrange.com
Before posting, please take a moment to review the archives
at http://archive.midrange.com/java400-l.


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

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.