|
I see you talk about file.open() which makes me think you are using record-level access instead of JDBC. As with the other Toolbox objects, the time to connect RLA is significant. In fact, if the program model is connect, open file, read data, close file, close connection, loop, the connection time will be as long or longer than file open / read data. Your file.open() call may be the first method call that requires server access so it connects, making the open call slow even though much of the time should be blamed on connection logic. If any of this is true then you can try optimizing connection logic. You say you are using swing. If you have enough info (server name, uid/pwd) ahead of time one change could be to connect in a background thread while swing is painting the gui. Then the connection step is done by the time you need data on the user's thread. A connection pool is also a possibility. Toolbox added a connection pool class in v5r1. Your first op may be slower because a connect is needed, but future requests will be faster because a connection already exists. The same discussion applies if you decide to switch to ProgramCall. Connection time will be significant so reuse connections whenever possible. It also applies to JDBC. David Wall AS/400 Toolbox for Java "Robert Upshall" <rupshall@psasoft To: <java400-l@midrange.com> .com> cc: Sent by: Subject: Speed question? java400-l-admin@m idrange.com 01/16/2002 09:08 AM Please respond to java400-l Hi, I have a question. I have a swing application that uses JTOpen classes to access DB2 files and to make pgm calls. My problem/concern is file access is so much slower that a pgm call, i.e. if I open a DB2 file in java and read a record it takes noticeably longer than if I was to call a RPG pgm to read the same record and return the record as parameters. The file.open() method appears to be the place I get the biggest speed hit. Is there any tweaking that I can do client and/or server side to speed this access? Anybody have any suggestions? Robert Upshall Professional Software of Amarillo (806) 358-8928 rupshall@psasoft.com _______________________________________________ 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 mailing list archive is Copyright 1997-2025 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.