|
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? 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? 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. 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. 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( new AS400(), "/QSYS.LIB/SANDBOX.LIB/SB0001.PGM", new ProgramParameter[] { new ProgramParameter(5) }); SimpleDateFormat sdf = new SimpleDateFormat("hh:mm:ss.SSS"); for (int x = 0; x < 100; x++) { pc.run(); String data = (String) at5.toObject(pc.getParameterList()[0].getOutputData()); String date = sdf.format(new Date()); System.out.println(date + " " + data); } sys.disconnectAllServices(); System.exit(0); } } Selected Results: 10:32:24.938 00001 10:32:24.938 00002 10:32:24.938 00003 10:32:25.016 00049 10:32:25.016 00050 10:32:25.016 00051 10:32:25.125 00098 10:32:25.125 00099 10:32:25.125 00100 _______________________________________________ This is the Java Programming on and around the iSeries / AS400 (JAVA400-L) mailing list To post a message email: JAVA400-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options, visit: http://lists.midrange.com/mailman/listinfo/java400-l or email: JAVA400-L-request@xxxxxxxxxxxx Before posting, please take a moment to review the archives at http://archive.midrange.com/java400-l. **************************************************************************** **** The information in this message is confidential and may be legally privileged. It is intended solely for the addressee; access to this email by anyone else is unauthorised. If you are not the intended recipient: (1) you are kindly requested to return a copy of this message to the sender indicating that you have received it in error, and to destroy the received copy; and (2) any disclosure or distribution of this message, as well as any action taken or omitted to be taken in reliance on its content, is prohibited and may be unlawful. **************************************************************************** **** _______________________________________________ This is the Java Programming on and around the iSeries / AS400 (JAVA400-L) mailing list To post a message email: JAVA400-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options, visit: http://lists.midrange.com/mailman/listinfo/java400-l or email: JAVA400-L-request@xxxxxxxxxxxx Before posting, please take a moment to review the archives at http://archive.midrange.com/java400-l. This e-mail has been sent by a company of Bertram Group Ltd, whose registered office is The Nest, Rosary Road Norwich NR1 1TF. This message, and any attachments, are intended solely for the addressee and may contain privileged or confidential information. If you are not the intended recipient, any disclosure, copying, distribution or any action taken or omitted to be taken in reliance on it, is prohibited and may be unlawful. If you believe that you have received this email in error, please contact the sender immediately. Opinions, conclusions and statements of intent in this e-mail are those of the sender and will not bind a Bertram Group Ltd company unless confirmed in writing by a director independently of this message. Although we have taken steps to ensure that this email and any attachments are free from any virus, we advise that in keeping with good computing practice the recipient should ensure they are actually virus free. _______________________________________________ This is the Java Programming on and around the iSeries / AS400 (JAVA400-L) mailing list To post a message email: JAVA400-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options, visit: http://lists.midrange.com/mailman/listinfo/java400-l or email: JAVA400-L-request@xxxxxxxxxxxx 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 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.