ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

JT400 Connection

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • JT400 Connection

    Hi, recently i developed a java program that use jt400 to connect to a dataqueue in AS400.

    Here is part of the code

    PHP Code:
    try {
      do {
        
    //Receive Data Queue
        //dqe = Data Queue Entry
        //dq = dataqueue
        
    dqe dq.read(-1);
        if(
    dqe != null){                  
          
    //Start Process
        
    }
      } while(
    true) ;
    } catch(
    Exception ex) {
      
    //Write to a file (ex.message)


    I got this problem.... the program seems to be running quite well in a few hours.. After a few hours the program seem do not work anymore and i dun get any exception messages from the catch statement.
    this program run on a pc that have different IP range with the AS400... i do not know whether this is the causes and i really appreciate if anyone can share their experience with me on this problem.

    AS400 IP - 10.0.59.11
    Java Program IP - 10.0.51.38

    thanks
    Last edited by gcraill; November 6, 2007, 03:23 AM. Reason: PHP Tags

  • #2
    Re: JT400 Connection

    Hi
    This is a network problem.
    Try a ping between the PC ans the iSeries.
    If it don't work, you should look at:
    - subnet mask: something like 255.255.0.0
    - is there a router ...

    Regards

    Comment


    • #3
      Re: JT400 Connection

      Its pays to check by pinging, but those IP addresses are compatable. Since it runs for "a few hours" it sounds like the problem might be
      - out of memory
      - loss of connection
      - garbage collection issues

      Comment


      • #4
        Re: JT400 Connection

        Could the connection be timing out? If nothing goes into the data que for a while is it possible that since no data gets passed that it times out? I would check Arrow's suggestions first though, especially the garbage collection.

        ^^^This was my original thought, upon relooking at your code I have another one...

        Is your Try inside of some kind of loop? Here's the thing. You have a do loop that is reading the dataque. Since you are already inside the Try block and that is executing like it is supposed to when the process is all caught up processing the dq then it exits the try/catch without error. I think that your code is doing what its supposed to do. You eventually get caught up with all that is in the dq and the loop ends and then thats it.

        That's what I'm getting from your snippet...
        Your future President
        Bryce

        ---------------------------------------------
        http://www.bravobryce.com

        Comment

        Working...
        X