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



Nigel,

On Freitag, 12. März 2004 15:04, NGay@xxxxxxxxxxxxx wrote:
> Colin,
>
> How would I make sure the server job stays open if I'm calling an RPG
> program say from within a WebSphere servlet/JSP application?  By keeping
> the com.ibm.as400.data.ProgramCallDocument object alive?  I suppose this
> could be achieved by storing the PCML object inside the WebSphere session?

Normaly the as400 Object represents the server jobs; keeping this object in 
the session of the Web Container runs into problems not later than you have 
multiple JVM instances and would have to serialize the session.

> Since two website users could access the same page at the same time and
> these would be running in seperate threads both users could end up
> retrieving the PCML object at the same time and trying to invoke the RPG
> program at the same time.  Surely some problems must arise trying to do
> things like this?

Not only two diffrent users, the same could happen for the same session!!! 
Normaly it would do to synchronize the access on the AS400 Object, if this 
doesn't do this internally anyway.

> Just plugging the question because we're in the same dilemma as everyone
> else having this discussion.  Historically all our core application is
> COBOL generated from COOL:2E, but many of those have become huge and
> unmaintanable so we are looking at slowly rewriting all the core business
> objects in Java, but this is much more based on Java code being more
> maintainable and better designed rather than any performance decisions.

Thats the point of primary interest.

> But it does mean we'll have Cobol 'green screens' calling Java programs to
> do their DB2 reads/updates in the background, and we'll also likely have
> Java programs running in the website which are calling RPG programs for
> their back ends.  I'm not really nervous about having a mix like this, just
> wondering if I should be :-) or if we're going to run into any major
> performance issues.

The real problem arises if the calls from java to ILE and ILE to Java is done 
in both directions in the same job, then deadlocks are possible and hard to 
detect. One way to avoid this, is to decouple the context. For instance using 
stored Procedures from java to Ile and some socket (or dataQ) based Batch 
Program for calls from ILE to Java. That should be no problem as long as the 
called modules are stateless.

Dieter



>
> Thanks,
>
> Nigel Gay.
>
> |---------+------------------------------------------------->
> |
> |         |           Colin Williams                        |
> |         |           <colin.williams@xxxxxxxxxxxx>         |
> |         |           Sent by:                              |
> |         |           java400-l-bounces+ngay=cpaglobal.com@m|
> |         |           idrange.com                           |
> |         |
> |         |
> |         |           12/03/2004 10:02                      |
> |         |           Please respond to Java Programming on |
> |         |           and around the iSeries / AS400        |
> |
> |---------+------------------------------------------------->
> |
>   >------------------------------------------------------------------------
>   >--------------------------------------|
>   >
>   |       To:       "'Java Programming on and around the iSeries / AS400'"
>   | <java400-l@xxxxxxxxxxxx>              | cc:                            
>   |                                                                       
>   | | Subject:  RE: Mixed RPG/Java performance (EXAMPLE CODE)              
>   |                                  |
>   |
>   >------------------------------------------------------------------------
>   >--------------------------------------|
>
> Nigel,
>
> One answer to this is to call your RPG from java as a stored procedure, and
> just pass a parameter to indicate when you want to do a close, just as you
> would from RPG.
>
> I believe that you should be able to achieve this without registering the
> RPG as a stored proedure, as long as you keep your as400 server job open
> between calls, and pass it the relevant parameter.
>
> Cheers
> Colin.W
>
> -----Original Message-----
> From: NGay@xxxxxxxxxxxxx [mailto:NGay@xxxxxxxxxxxxx]
> Sent: 12 March 2004 12:22
> To: Java Programming on and around the iSeries / AS400
> Subject: RE: Mixed RPG/Java performance (EXAMPLE CODE)
>
>
>
> Joe,
>
> What about when the RPG has a few tables to open up and access?  If you
> called the same RPG program say 100 times, and the RPG program accessed say
> 5 DB2/400 tables, wouldn't it re-open those tables on every call?  With an
> RPG program calling another RPG program you can get it to keep the tables
> open so you don't have this overhead each time but when calling from Java
> isn't a totally new RPG environment on each call and so there'd be a huge
> overhead every time of opening up all the tables?  This is the kind of
> thing
> which worries me about calling RPG from Java - not the speed of the program
> call itself.
>
> Thanks,
>
> Nigel Gay.
>
> |---------+------------------------------>
> |
> |         |           "Joe Pluta"        |
> |         |           <joepluta@plutabrot|
> |         |           hers.com>          |
> |         |           Sent by:           |
> |         |           java400-l-bounces@m|
> |         |           idrange.com        |
> |         |
> |         |
> |         |           11/03/2004 13:27   |
> |         |           Please respond to  |
> |         |           Java Programming on|
> |         |           and around the     |
> |         |           iSeries / AS400    |
> |
> |---------+------------------------------>
> |
> >--------------------------------------------------------------------------
> >-
>
> -----------------------------------|
>
>   |       To:       "'Java Programming on and around the iSeries / AS400'"
>
> <java400-l@xxxxxxxxxxxx>              |
>
>   |       cc:
>   |
>   |       Subject:  RE: Mixed RPG/Java performance (EXAMPLE CODE)
> >
> >--------------------------------------------------------------------------
> >-
>
> -----------------------------------|
>
> > You have a problem.  I can call a program hundreds of times a second,
> > and that's from my PC to my little model 270.  I included the RPG
> > program, the Java program and the results at the end of this post.
>
> CODE FOR EXAMPLE:
>
> Program SB0001 in library SANDBOX
>
> d xidata          ds
> d   counter                      5  0
> d xwcount         s              5  0
>
> C     *entry        plist
> C                   parm                    xidata            5
> C
> C                   eval      xwcount = xwcount + 1
> C                   eval      counter = xwcount
> C                   return
>
>
> Java class CallSB0001
>
> public class CallSB0001 {
>
>              private static AS400Text at5 = new AS400Text(5);
>
>              public static void main(String[] args)
>                          throws Exception
>              {
>                          AS400 sys = new AS400();
>
>                          ProgramCall pc = new ProgramCall(

-- 
mfG

Dieter Bender


DV-Beratung Dieter Bender
Wetzlarerstr. 25
35435 Wettenberg
Tel. +49 641 9805855
Fax +49 641 9805856
www.bender-dv.de
eMail dieter.bender@xxxxxxxxxxxx


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.