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



John:

Like you, I think JNI is a much more elegant and simple way for Java to
interact with RPG.

I'm going through the whole debate again with my client about use of stored
procedures with JDBC versus JNI (for Java to RPG calls). The biggest
stumbling block against adopting JNI for call-out from a Java application to
RPG back-end is the necessity to make the entire RPG Module threadsafe with
the TREAD(*SERIALIZE) keyword in the H-Spec. Unfortunately, while a JNI call
is being made, ILE locks with the service program object, not permitting any
other Java thread to enter any procedure (at all) in that service progranm
(or possibly that module in that service program, I'm not sure). If you
remove the THREAD(*SERIALIZE), then you're going to have issues with
inherent and internal shared static storage between threads. Even though a
JNI call does cause the RPG to run in the same process as the Java, with no
separate job spawned, (and therefore potentially performs better), when in a
multithreaded application (such as a servlet), you will certainly have
scalability issues due to the limitation of THREAD(*SERIALIZE), unless you
are calling very small and fast RPG procedures.

Any thoughts from you or other members of the mailing list would be
appreciated. (When is IBM going to make RPG truly multithreaded?!).

Chris Jewell

-----Original Message-----
From: java400-l-admin@midrange.com
[mailto:java400-l-admin@midrange.com]On Behalf Of Jon Paris
Sent: Sunday, December 08, 2002 7:44 PM
To: java400-l@midrange.com
Subject: java to rpg problem


 >> Cool.  What are the advantages vs. using the Toolbox with native
optimizations?

Mark, I'm afraid I can't answer that in performance terms.  It is a JNI call
so there are so issues there - but I do know it is a hell of a lot simpler!

1) Add the keyword to the RPG.
2) Code a prototype for the native method in the Java
3) Add the system.loadlibrary identifying the service program to use.

That's it.

Me - I like simple.


Jon Paris
Partner400


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

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.