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



Barbara,

I am freeing my resources after using them.  I am also creating specific
objects, using them, then freeing the resources instead of creating objects
without references (variables).  I read the V5R2 and was surprised that this
was allowed to occur.  I do not specifically end the JVM.  what I am doing
is calling the RPG program each time I need to use this Java class.  It is
within the same job and occurs one after the other after the RPG program is
returned.  I do end the RPG program with turning on *INLR.  I wrote this on
a V5R2 box, but I am running it on a V5R1 box.  I will have to review the
V5R2 info again....

Mike



Mike Silvers wrote:
>
> I have run into an interesting issue with a direct call to Java from an
RPG
> program.  After doing multiple calls within the same job, I ran into a
> StringIndexOutOfBoundsException during one of the calls.
> ...

Mike, are you ending the JVM between calls?  Even if you're not
explicitly ending the JVM, if you are on V5R1, ending any activation
group will cause the JVM to end.  It's not really supported to end the
JVM and start it again, so subsequent calls may or may not work well.
(In V5R2, ending an activation-group doesn't cause the JVM to end, and
it's not supported to explicitly destroy the JVM.)

Aside from ending the JVM, there are other ways to misuse Java.  Are you
freeing your Java resources?  If you end your RPG program with LR on,
and you don't free all your Java objects, eventually you will run into
memory problems.  If you've only read the V5R1 ILE RPG Programmer's
Guide section on calling Java, read the V5R2 version too - there's a bit
more information on ways that Java objects can be lost through incorrect
programming.


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