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



That would only be used the first time Java was invoked for a job. Once the JVM has started, it will not look at classpath again, afaik...

Eric

-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx
[mailto:rpg400-l-bounces@xxxxxxxxxxxx]On Behalf Of Bradley V. Stone
Sent: Thursday, June 12, 2008 9:43 AM
To: RPG programming on the AS400 / iSeries
Subject: RE: RPG, Java and Classpath practices


Quick question.

I noticed on the JAVA command you can specify a classpath. Would using this
be a bad idea? Does it start a new JVM every time it runs? Or how exactly
does this work?

For example, if another application used the JAVA command and specified a
classpath, if I use it afterward it start a new JVM and use my classpath, or
will the first call have started it's own JVM and again be in the situation
where you can't change the classpath?



Bradley V. Stone
BVSTools - www.bvstools.com
eRPG SDK - www.erpgsdk.com

-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx
[mailto:rpg400-l-bounces@xxxxxxxxxxxx]On Behalf Of David Gibbs
Sent: Thursday, June 12, 2008 8:34 AM
To: RPG programming on the AS400 / iSeries
Subject: Re: RPG, Java and Classpath practices


Bradley V. Stone wrote:
So, looking for ideas on handling this. In a nutshell, you have a
standalone app that uses Java inside of RPG and you want to ensure the
classpath is set properly when your application runs, no matter
what else
they are running or if the JVM is already running for that job.

Brad:

FWIW, I'm not a big fan of invoking Java directly from RPG. I know it
can be done but, for the same reasons you mention, I don't think it's a
great idea.

Personally I would suggest you start the java process up in a daemon job
and communicate to it with data queues. Simply have the java process
monitor a queue for commands and have your RPG send the command requests
through the queue.

That way you only have the JVM startup penalty once ... and the job is
running in batch. Your RPG program suffers no performance impact
because the data queue api is relatively light weight.

Obviously all ther java code would have to be in your daemon job's
classpath.

JMO, obviously.... but I've been using this kind of technique for quite
a while with great success (using sockets though, not data queues ...
given a chance to rework the implementation, I would probably use a data
queue).

david

--
IBM System i - For when you can't afford to be out of business

--
This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

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.