Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » EGL Development Tools » Accessing the correct iSeries Library
Accessing the correct iSeries Library [message #763173] Fri, 09 December 2011 09:45 Go to next message
Bob NIcholson is currently offline Bob NIcholsonFriend
Messages: 62
Registered: December 2011
Location: Seattle
Member
I'm doing the EDT:Tutorial: RUI With Database tutorial. I seem to have it working except that it is trying to access the file in the wrong iSeries library. The user ID is BOB. The library containing the PaymentRec is BNLIB.

I receive the following error:
Exception: SQLService, addPayment, SQLSTATE = 42704, message = [SQL0204] PAYMENT in BOB type *FILE not found.: [sqlstate:42704][sqlcode:-204]

So it is looking for library BOB which does not exist.

In RBD, all I did was qualify the table name with the correct library. I've tried that here but it makes no difference.

I have multiple client machines installed and each will have files in multiple libraries for production,testing and development. All customers run the exact same version of the software package so I don't want to have a project for each customer's environment. It would be nice if there is an environment variable somewhere that can control the file/library combinations for each implementation.

How should this be handled? I'm assuming I can have multiple deployment descriptor files for each client emplimentation to point to the right machine address, but I'm not sure.

Thanks

Bob

[Updated on: Fri, 09 December 2011 09:46]

Report message to a moderator

Re: Accessing the correct iSeries Library [message #763605 is a reply to message #763173] Sat, 10 December 2011 04:27 Go to previous messageGo to next message
Will Smythe is currently offline Will SmytheFriend
Messages: 41
Registered: July 2009
Member
Hi Bob - did you define a database connection using the Eclipse Data Tools (Database Development perspective)? If so, are you able to connect and explore your tables using the Data Source Explorer view?

Also, is BNLIB in your library list? If not, did you specify it in your connection URL (jdbc:as400://myas400;prompt=false;libraries=BNLIB)? You can set the connection URL in the EGL Deployment Descriptor (DD) file (located under EGLSource of your project). You will need to have a SQL Resource Binding that copied the connection info into the DD versus linking to the workspace connection profile ..
Re: Accessing the correct iSeries Library [message #763654 is a reply to message #763605] Sat, 10 December 2011 07:58 Go to previous messageGo to next message
Bob NIcholson is currently offline Bob NIcholsonFriend
Messages: 62
Registered: December 2011
Location: Seattle
Member
Thanks Will. That resolved the problem with accessing the db from preview mode and local deployment to Tomcat 6. However, I'm still having a problem when I deploy to Tomcat on my iSeries and then try to access the payment file maintenance. Here's the error. I can't tell from the messages what I need to do. thanks

Failure: service invocation, exception = [CRUU3658E] An error occurred on proxy at '/PaymentWebBAI/___proxy' while trying to invoke service on 'services.SQLService'
Detail 1: 500
Detail 2: Internal Server Error
Detail 3:
Re: Accessing the correct iSeries Library [message #763750 is a reply to message #763654] Sat, 10 December 2011 13:36 Go to previous messageGo to next message
Will Smythe is currently offline Will SmytheFriend
Messages: 41
Registered: July 2009
Member
Are you deploying the same WAR file to your local Tomcat and your Tomcat on i? If so, are you running the same version of Tomcat (v6) on both? What version of Java are you running on i?
Re: Accessing the correct iSeries Library [message #763821 is a reply to message #763750] Sat, 10 December 2011 17:12 Go to previous messageGo to next message
Bob NIcholson is currently offline Bob NIcholsonFriend
Messages: 62
Registered: December 2011
Location: Seattle
Member
I'm running 5.5 on my iSeries and 5.5 on my laptop. I do, however, also have 6.0 on my laptop. I first did everything on 6.0 on my laptop and then created a second deployment for 5.5. I had originally deployed the 6.0 version to my iSeries and thn remembered that it is 5.5. So, I created a 5.5 server on my laptop, deployed it and tested it on my laptop and it runs fine. I then exported the 5.5 war file and installed it on my iSeries and that's were I'm getting the error. I did get the same error trying to run the 6.0 war file on my 5.5 iSeries originally and that's when I remembered I needed 5.5.

Thanks for any tips.
Re: Accessing the correct iSeries Library [message #763833 is a reply to message #763821] Sat, 10 December 2011 17:29 Go to previous messageGo to next message
Will Smythe is currently offline Will SmytheFriend
Messages: 41
Registered: July 2009
Member
What version of Java is running on your i? If it's 1.4, you need to move up to at least 5.0 (1.5).
Re: Accessing the correct iSeries Library [message #763905 is a reply to message #763833] Sat, 10 December 2011 21:42 Go to previous messageGo to next message
Bob NIcholson is currently offline Bob NIcholsonFriend
Messages: 62
Registered: December 2011
Location: Seattle
Member
Here's what I have on licensed programs. I think this should be okay. I'm just not too good at the JAVA stuff. I was having this same problem trying to deploy RBD.

5761JV1 V6R1M0 IBM Developer Kit for Java
5761JV1 V6R1M0 J2SE 5.0 32 bit
5761JV1 V6R1M0 J2SE 5.0 64 bit
5761JV1 V6R1M0 Java SE 6 32 bit
5761JV1 V6R1M0 Java SE 6 64 bit
Re: Accessing the correct iSeries Library [message #763928 is a reply to message #763905] Sat, 10 December 2011 23:14 Go to previous messageGo to next message
Bob NIcholson is currently offline Bob NIcholsonFriend
Messages: 62
Registered: December 2011
Location: Seattle
Member
I'm attaching a couple of Apache/Tomcat logs from my iSeries. It looks like something is the wrong version. I'm not sure if this is the problem. Maybe someone smarter than I am regarding Apache/Tomcat/Java can help out.
Re: Accessing the correct iSeries Library [message #763935 is a reply to message #763928] Sat, 10 December 2011 23:46 Go to previous messageGo to next message
Joe Pluta is currently offline Joe PlutaFriend
Messages: 62
Registered: November 2011
Member
Hi Bob! You seem to have a couple of different issues here, let's do one at a time. The first log looks like it's from your local machine (I assume that's your PC). The key error there is the java.lang.UnsupportedClassVersionError. This almost always means you are using a version of Java that is too old for the application that you are running. Even if you have installed the latest Java, it might not be running by default. You need to get to a command line, do two things and report back:

1. echo $JAVA_HOME
2. java -version

The first tells us where applications like Tomcat (usually) will find the version of Java that they will load. The second is to determine what the PC thinks it has as its default. It really helps when these two match. Okay, that's it for the Java version.

Second, it looks like the IBM i version is starting up just fine. It's using the 32-bit version of JDK 5.0, which is a good, fast version that works nicely with Tomcat. Your only problem there is the fact that it's trying to find your file in library BOB. That's because by default JDBC uses SQL naming convention and SQL naming convention uses a single schema. A schema is what we think of as a library, and the schema it uses is the one with the same name as the user profile. So any unqualified database fetches go to library BOB.

There are a number of ways to fix that, but I would start by qualifying the library name, just to make sure we're on the same page. You said you were trying that; did you try using the table name BNLIB.PAYMENT? In SQL, the qualifier is a dot, not a slash.

Try those and let us know if it gets you any farther.

Joe
Re: Accessing the correct iSeries Library [message #763939 is a reply to message #763935] Sun, 11 December 2011 00:00 Go to previous messageGo to next message
Will Smythe is currently offline Will SmytheFriend
Messages: 41
Registered: July 2009
Member
Bob - looks like the EGL runtime classes were compiled in a Java version greater than what you are running. So, looks like you need to move up to Java 1.6/6 on your i.

(Thought/assumed EGL runtime was compiled with 1.5/5, guess not)
Re: Accessing the correct iSeries Library [message #763942 is a reply to message #763935] Sun, 11 December 2011 00:09 Go to previous messageGo to next message
Bob NIcholson is currently offline Bob NIcholsonFriend
Messages: 62
Registered: December 2011
Location: Seattle
Member
Hi, Joe

I've attached the results of the two commands. I'm not sure what you mean that they should look the same.

For the second part, I'm actually able to run the application and access the data now when I'm deployed to the Tomcat 5.5 server on my laptop. So, I think the problem with the library is resolved. The only problem I'm having now is serving the application from my iSeries. That's where it fails with the error:

Failure: service invocation, exception = [CRUU3658E] An error occurred on proxy at '/PaymentWebBAI/___proxy' while trying to invoke service on 'services.SQLService'
Detail 1: 500
Detail 2: Internal Server Error
Detail 3:

Thanks
Re: Accessing the correct iSeries Library [message #763945 is a reply to message #763939] Sun, 11 December 2011 00:20 Go to previous messageGo to next message
Bob NIcholson is currently offline Bob NIcholsonFriend
Messages: 62
Registered: December 2011
Location: Seattle
Member
Hi, Will

Since it looks like I have 1.6 on my laptop, I think you are probably right.

Since I have have customers running different versions on their iSeries machines, is there a way to compile for the different versions based on deployment targets? Or, should I be compiling for oldest version of java on any of my customer's iSeries? Or should I take 1.6 off my laptop and install 1.5?

[Updated on: Sun, 11 December 2011 01:01]

Report message to a moderator

Re: Accessing the correct iSeries Library [message #763974 is a reply to message #763945] Sun, 11 December 2011 02:33 Go to previous messageGo to next message
Will Smythe is currently offline Will SmytheFriend
Messages: 41
Registered: July 2009
Member
Hi Bob - the problem is not the version of Java you are using on your development machine, but instead the version of Java 'we' are using to compile the EGL runtime classes. Based on the error message, it seems we are using 1.6 to compile, which means 1.6 is the lowest level of Java you can use to run your app.

The nice thing about open source is that you have access to the source and could compile the EGL runtime classes with 1.5 (assuming nothing in these classes depends on 1.6). It would be an interesting exercise ...
Re: Accessing the correct iSeries Library [message #764032 is a reply to message #763974] Sun, 11 December 2011 06:34 Go to previous messageGo to next message
Bob NIcholson is currently offline Bob NIcholsonFriend
Messages: 62
Registered: December 2011
Location: Seattle
Member
Thanks, Will.

I've determined that the iSeries comes with 1.5 and 1.6 in both 32 bit and 64 bit versions. By setting the environment variable when starting Tomcat, I can set the version I wish to run. So, I now have the application running on my iSeries on the Tomcat server using Tomcat 6 and Java 1.6. But there is still a problem. I'm getting about 20 second response times on any application server request i.e. loading the sample data. Running the same project on my laptop against the same iSeries Database is almost instantaneous.

Would you have any idea as to why the java service programs would be so slow running on the iSeries?

Thanks for the help.

Bob
Re: Accessing the correct iSeries Library [message #764042 is a reply to message #764032] Sun, 11 December 2011 07:18 Go to previous messageGo to next message
Joe Pluta is currently offline Joe PlutaFriend
Messages: 62
Registered: November 2011
Member
Sorry about that, I was reading the results incorrectly. I thought the first log was from your PC and the second from your iSeries, when in fact both logs were from your iSeries as you clearly stated. Sorry, my bad. But the resolution was correct and as Will pointed out it had to do with the fact that EDT is compiled to Java 6. You have fixed your Tomcat to run the right JVM, and now you're on to performance.

Performance problems come from many places. What do your logs tell you? Many times I have found sluggish performance of Java applications to be a problem with not enough memory being allocated to the JVM. iSeries swapping for traditional work loads does not work well with Java. Typically I configure the subsystem in which Java runs to have its own memory pool and that way JVM and iSeries swapping don't interfere with one another.
Re: Accessing the correct iSeries Library [message #764226 is a reply to message #764042] Sun, 11 December 2011 17:58 Go to previous messageGo to next message
Bob NIcholson is currently offline Bob NIcholsonFriend
Messages: 62
Registered: December 2011
Location: Seattle
Member
Thanks Joe. I'll take a look at that. I also have other java applications running on my iSeries (and customer machines) under Tomcat 5 and Java 1.5 without any response time problems. They are very fast. So, I'm not sure why the EGL/Tomcat6/Java1.6 should be so slow. This is just a development machine with virtually nothing running most of time except what I'm testing. It also looks like I'll have to figure out how to run both environments at the same time (I think this is just a matter of changing ports) or move the Tomcat 5/java 1.5 applications to the other environment.

I'll let you know.
Re: Accessing the correct iSeries Library [message #764303 is a reply to message #764226] Sun, 11 December 2011 22:11 Go to previous messageGo to next message
Joe Pluta is currently offline Joe PlutaFriend
Messages: 62
Registered: November 2011
Member
Well, let's take a look at this. You say you have applications running on Tomcat 5 on Java 5 and they run fine, but you have problems with EGL running on Tomcat 6 on Java 6. Perhaps to take one of the variables out of the equation, you could run one of your existing applications by installing the WAR file on your Tomcat 6 environment and compare the performance. If it performs well, then that would indicate an issue with EGL. If not, then it's more likely a problem with your Tomcat 6 setup.

Running multiple Tomcat environments should be pretty simple. The iSeries easily supports multiple IP addresses, so just add another IP address and make sure your Tomcat configurations each listen to a different IP address. Yes, you can use ports, but I prefer IP addresses.

Just so I have a clearer understanding - are you running Tomcat with an Apache front end, or just running Tomcat standalone? If you're running standalone on a machine with multiple IP addresses, you can bind Tomcat to a specific IP address easily by adding an address="my.ip.addr.ess" on every connector tag in your server.xml file.

Keep updating us on your progress!

Joe
Re: Accessing the correct iSeries Library [message #764375 is a reply to message #764303] Mon, 12 December 2011 03:46 Go to previous messageGo to next message
Bob NIcholson is currently offline Bob NIcholsonFriend
Messages: 62
Registered: December 2011
Location: Seattle
Member
Well, I've been able to load another WAR file that was running on Tomcat5/java1.5 and it seems to execute fine. When running the EGL, I can't seem to find any errors in the logs.
Re: Accessing the correct iSeries Library [message #764382 is a reply to message #764375] Mon, 12 December 2011 04:17 Go to previous messageGo to next message
Joe Pluta is currently offline Joe PlutaFriend
Messages: 62
Registered: November 2011
Member
Okay, now that you seem to have isolated the problem to the EGL, then the next thing I would do would be to sprinkle some Syslib.writestdout calls throughout the code to see where the time is going.

Joe
Re: Accessing the correct iSeries Library [message #764454 is a reply to message #764382] Mon, 12 December 2011 08:03 Go to previous messageGo to next message
Bob NIcholson is currently offline Bob NIcholsonFriend
Messages: 62
Registered: December 2011
Location: Seattle
Member
Okay, I've done some timings. It looks to me like there is something funny when the sql is run to load the table. I've attached two files showing the timings between running on the iSeries and running on my laptop.
I've marked the timings in question. As you can see, it takes about 20 times longer to get a response from the sql command when running on the iSeries then on the laptop.

I found an info statement in the log on the iSeries that may have a bearing on this but I'm not sure. That statement is:
INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the ja

What do you think?

Thanks

Bob

[Updated on: Mon, 12 December 2011 08:09]

Report message to a moderator

Re: Accessing the correct iSeries Library [message #764622 is a reply to message #764454] Mon, 12 December 2011 14:51 Go to previous messageGo to next message
Joe Pluta is currently offline Joe PlutaFriend
Messages: 62
Registered: November 2011
Member
Well, if I get a chance I'll try to run this, but I'm a little tight on time. Smile However, looking at your timings, it's clear the problem is the delete. The code just isn't that much:
try
    execute from ds
    with #sql{
      delete from PAYMENT
    };
onException(ex SQLException)
    if(ex.SQLState != "02000")  // sqlState is five digits
        throw ex;
    end
end

This just deletes all the records in PAYMENT. It shouldn't take 20 seconds and obviously it doesn't when run from the laptop. Have you looked at all the usual suspects as far as logs go? I'm talking about DSPLOG QHST to see if something odd is happening, and also trying to find the appropriate QZDASOINIT job. Once you've identified the QZDASOINIT job, try to re-run the application and see if you're getting a lock wait or some other abnormal result.

Joe
Re: Accessing the correct iSeries Library [message #764746 is a reply to message #764622] Mon, 12 December 2011 19:26 Go to previous messageGo to next message
Bob NIcholson is currently offline Bob NIcholsonFriend
Messages: 62
Registered: December 2011
Location: Seattle
Member
Hi, Joe

Well, this is interesting. In order to eliminate the delete from the equation, I commented out the delete try block. The delay still exists but it has moved to the next sql statement. That is in the addPayment function. So, it appears to be something to do with the set up of the first sql statement. After that it seems to execute the rest of the sql statements quickly.

Since there is no delay in execution of the sql from my laptop, it's like there is a problem when SQL is run iSeries Java to iSeries SQL. From laptop to iSeries I assume is done with some type of tcpip request. Having little experience with this, I'm not sure what goes on under the covers.

I shouldn't think this has anything to do with record locks because there is no delay when running from my laptop. The iSeries seems to respond quicker to that remote access method than locally.

Your thoughts would be apprecieated.

Bob

[Updated on: Mon, 12 December 2011 19:28]

Report message to a moderator

Re: Accessing the correct iSeries Library [message #764776 is a reply to message #764746] Mon, 12 December 2011 20:37 Go to previous messageGo to next message
Joe Pluta is currently offline Joe PlutaFriend
Messages: 62
Registered: November 2011
Member
Hmmm... the plot thickens! Okay, while I'm no expert on all the intricacies, I can make a few broad statements and hopefully a few IBMers can chime in as well.

Generally speaking, database requests from Java to DB2 all go through the same basic JDBC mechanism. There are various ways in which a database connection can be configured, but at the end of the day you will be using a database connection resource. Database resources are configured in the deployment descriptor, which can in turn point to workspace-wide database connections that you can configure using the Database Development Perspective.

The point is that at some point you should find a database driver URL, and it should look something like this:

jdbc:as400:MYISERIES;prompt=false

There are a number of different syntax possibilities, but this is one I use. I guess the next step would be for you to find that URL and let us see it. It could be a strange routing problem that's affecting you. I am surprised, though, that your log doesn't say that you're connecting to the database, with messages like this:

DSRA8203I: Database product name : DB2 UDB for AS/400
DSRA8204I: Database product version : 07.01.0000 V7R1m0
DSRA8205I: JDBC driver name : AS/400 Toolbox for Java JDBC Driver
DSRA8206I: JDBC driver version : 8.2

Joe
Re: Accessing the correct iSeries Library [message #765295 is a reply to message #764776] Tue, 13 December 2011 19:46 Go to previous messageGo to next message
Bob NIcholson is currently offline Bob NIcholsonFriend
Messages: 62
Registered: December 2011
Location: Seattle
Member
Hi, Joe

Thanks for sticking with me on this. Sorry for the delay. I messed the whole thing up somehow and had to rebuild the tutorial again. Unfortunately, the problem still persists.

I'm not sure exactly what you are looking for here. But, here are the deployment descriptors for PaymentClient and PaymentService projects.

I can't find anything in any logs about connecting to the database. But, it may be that I'm not looking in the correct place.

I am wondering if the problem might be related to the fact that the URL is www.busapp.com instead of "localhost". Might that be causing the delay by resolving the URL.

PaymentService;

<?xml version="1.0" encoding="UTF-8"?>
<egl:deployment xmlns:egl="http://www.eclipse.org/xmlns/edt/deployment/1.0">
  <bindings>
    <binding name="BAI" type="edt.binding.sql" useURI="false">
      <parameters>
        <parameter name="dbms" value="DB2 for i5/OS"/>
        <parameter name="sqlID" value="user"/>
        <parameter name="sqlPassword" value="xxxxxxxx"/>
        <parameter name="jarList" value="C:\IBM\jt400.jar"/>
        <parameter name="sqlJDBCDriverClass" value="com.ibm.as400.access.AS400JDBCDriver"/>
        <parameter name="sqlDB" value="jdbc:as400:www.busapp.com;prompt=false;libraries=BNTEST"/>
      </parameters>
    </binding>
  </bindings>
</egl:deployment>


And from the PaymentClient:

<?xml version="1.0" encoding="UTF-8"?>
<egl:deployment xmlns:egl="http://www.eclipse.org/xmlns/edt/deployment/1.0">
  <bindings>
    <binding name="BAI" type="edt.binding.sql" useURI="false">
      <parameters>
        <parameter name="dbms" value="DB2 for i5/OS"/>
        <parameter name="sqlID" value="user"/>
        <parameter name="sqlPassword" value="xxxxxxxx"/>
        <parameter name="jarList" value="C:\IBM\jt400.jar"/>
        <parameter name="sqlJDBCDriverClass" value="com.ibm.as400.access.AS400JDBCDriver"/>
        <parameter name="sqlDB" value="jdbc:as400:www.busapp.com;prompt=false;libraries=BNTEST"/>
      </parameters>
    </binding>
  </bindings>
  <egl:target.project name="PaymentWeb"/>
</egl:deployment>


Thanks

Bob
Re: Accessing the correct iSeries Library [message #765317 is a reply to message #765295] Tue, 13 December 2011 20:33 Go to previous messageGo to next message
Joe Pluta is currently offline Joe PlutaFriend
Messages: 62
Registered: November 2011
Member
Quote:
I am wondering if the problem might be related to the fact that the URL is www.busapp.com instead of "localhost". Might that be causing the delay by resolving the URL.


Yes, yes, yes! That might well be the problem! I have regularly run into problems when trying to use a DNS resolvable name to resolve to the machine I am running on. Now, I am in NO way a DNS guy, so take it with a grain of salt, but perhaps you can try changing that to the actual IP address of the host for now. That should work on both the PC and the host.

What I do is use a simple name (e.g., "MYI") and then put that both in the HOSTS file on the PC and in the CFGTCP settings on the IBM i.

As to why you're not seeing the logging message, I have no idea. But let's try one thing at a time, eh? Smile

Joe
Re: Accessing the correct iSeries Library [message #765411 is a reply to message #765317] Wed, 14 December 2011 01:51 Go to previous messageGo to next message
Bob NIcholson is currently offline Bob NIcholsonFriend
Messages: 62
Registered: December 2011
Location: Seattle
Member
Another dead end. Changing to the IP address did not help.

Is it possible that the java is not getting compiled into native iSeries Code or is being compiled for each execution?

What about converting to WSDL with REST or SOAP ? I'm not sure I can figure that out for EDT unless maybe they have a tutorial for it.
Re: Accessing the correct iSeries Library [message #765671 is a reply to message #765411] Wed, 14 December 2011 13:47 Go to previous messageGo to next message
Joe Pluta is currently offline Joe PlutaFriend
Messages: 62
Registered: November 2011
Member
Did not help... as in the exact same timing? 24 seconds to initiate the first request? Then it's definitely time to find the logs. Find out how to make your JDBC connection as verbose as possible, set on EGL tracing, etc.

Hopefully some of the folks here can help you with the EGL tracing. A minor mod to your connection URL should enable JDBC tracing:

jdbc:as400:HOST;prompt=false;libraries=BNTEST;toolbox trace=all;trace=true

And in my copious free time I'll try to find a minute to run this tutorial on my machine at home and see what happens.

Joe
Re: Accessing the correct iSeries Library [message #765875 is a reply to message #765671] Wed, 14 December 2011 20:23 Go to previous messageGo to next message
Bob NIcholson is currently offline Bob NIcholsonFriend
Messages: 62
Registered: December 2011
Location: Seattle
Member
Hi, Joe

I've attached a portion the more detailed log that appears to me to contain the delay. I've marked those statements in yellow.

Also, built this same tutorial in the RBD tool and deployed it to my iSeries. It runs just fine with response times of less than a second. Below are the SQL db definitions for both. I tried using "DB2" in stead of "DB2 for i5/OS" and it made no difference.

Thanks.

Bob

RBD:
	dbms="DB2"
	sqlValidationConnectionURL="jdbc:as400:www.busapp.com;prompt=false;libraries=BNTEMP"
	sqlJDBCDriverClass="com.ibm.as400.access.AS400JDBCDriver"
	sqlDB="jdbc:as400:www.busapp.com;prompt=false;libraries=BNTEMP"
	sqlID="xxxxxx" sqlPassword="crypto:0ac28eeb7eab02de">

EDT:
	<parameter name="dbms" value="DB2 for i5/OS"/>
        	<parameter name="sqlID" value="xxxxxx"/>
        	<parameter name="sqlPassword" value="xxxxxxxx"/>
        	<parameter name="jarList" value="C:\IBM\jt400.jar"/>
        	<parameter name="sqlJDBCDriverClass" value="com.ibm.as400.access.AS400JDBCDriver"/>
<parameter name="sqlDB" value="jdbc:as400:S10746FP;prompt=false;libraries=BNTEST;toolbox trace=all;trace=true"/>


Re: Accessing the correct iSeries Library [message #765897 is a reply to message #765875] Wed, 14 December 2011 21:17 Go to previous messageGo to next message
Joe Pluta is currently offline Joe PlutaFriend
Messages: 62
Registered: November 2011
Member
I'm going to go out on a limb here and say the problem is definitely the address resolution. The code is trying to see if this is the local machine. It first checks fior the name "localhost", and if that fails it compares the name requested against a list of all names on the host. That code (getAllByName) is what's killing you. It runs very quickly on your PC, but takes a long time on the IBM i. To be sure that's the problem, please try changing your JDBC URL to "localhost" and then running that on the host. My guess is it will run very quickly.
// Check if systemName refers to the system we are running on.
private static boolean isSystemNameLocal(String systemName) {
    if (systemName.equalsIgnoreCase("localhost")) {
        if (Trace.traceOn_)
            Trace.log(Trace.DIAGNOSTIC,
                    "System name is 'localhost'.");
        return true;
    } else {
        try {
            InetAddress localInet = InetAddress.getLocalHost();
            InetAddress[] remoteInet = InetAddress
                    .getAllByName(systemName);

            for (int i = 0; i < remoteInet.length; ++i) {
                if (Trace.traceOn_)
                    Trace.log(Trace.DIAGNOSTIC,
                            "Comparing local address " + localInet
                                    + " to " + remoteInet[i]);
                if (localInet.equals(remoteInet[i])) {
                    return true;
                }
            }
        } catch (UnknownHostException e) {
            Trace.log(Trace.ERROR,
                      "Error retrieving host address information:",
                      e);
        }
    }
    if (Trace.traceOn_)
        Trace.log(Trace.DIAGNOSTIC, "System name is not local.");
    return false;
}

Re: Accessing the correct iSeries Library [message #765992 is a reply to message #765897] Thu, 15 December 2011 03:17 Go to previous messageGo to next message
Bob NIcholson is currently offline Bob NIcholsonFriend
Messages: 62
Registered: December 2011
Location: Seattle
Member
Hi, Joe

Well, that improved it considerably. However, it is still very sluggish compared to RBD developed app especially if it sits for a few minutes. If you would like to see the difference, you may be able to get a feel by accessing the apps on my site. I just add and delete a record over and over a few times to get a feel of the response time.

For EDT: http://www.busapp.com:8080/PaymentWeb/PaymentFileMaintenance.html

For RBD: http://www.busapp.com:8080/PaymentWebRBD/PaymentFileMaintenance-en_US.html

I'm not sure we can do any better for now and I'm not sure this is fast enough for production. But, hopefully, EDT will improver over time.

Thanks for taking the time out of your busy schedule to help. If you have any more ideas, it would still be appreciated.

BTW: I read your book and found it very informative. Thanks for taking the time to write it.
Re: Accessing the correct iSeries Library [message #766281 is a reply to message #765992] Thu, 15 December 2011 13:54 Go to previous message
Joe Pluta is currently offline Joe PlutaFriend
Messages: 62
Registered: November 2011
Member
Okay, that's a different discussion. I was focusing on why an EDT-generated application on the PC was so much faster than the same application on the host. That was comparing apples to apples and we've resolved the issue for the most part.

Now with RBD and EDT you're comparing oranges and grapefruit and I think in order to identify performance differences between the two you're going to have to get some help from the IBM team.

And thanks, it was a hoot writing the EGL book. Maybe someone will enlist my services to write an EDT book, you never know. Although by the end of the project, I promised myself I'd never write another bleeding edge technology book - every month I'd finish a few chapters just to find out the previous two were obsolete. Evil or Very Mad
Previous Topic:EGL web project security setting
Next Topic:Silly qn: how to enable the 'event' in my IDE?
Goto Forum:
  


Current Time: Fri Apr 19 13:57:58 GMT 2024

Powered by FUDForum. Page generated in 0.03444 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top