This discussion is archived
4 Replies Latest reply: May 18, 2012 1:31 AM by EJP RSS

Sun corba service set time out

937996 Newbie
Currently Being Moderated
Hi im coding a corba client service using sun default library(without using any 3rd lib. e.g jacorb /visibroker). Is there anyway to set client timeout. This is to solve when server is down then my client won't hog the thread and keep the connection active. As of now if the host is down, i will wait forever, the timeout from sun is very unconsistence
  • 1. Re: Sun corba service set time out
    EJP Guru
    Currently Being Moderated
    Warning: this information came from the Java 1.5 source code and only applies to Sun's release of that version. It may work in other versions. Anyway you get the general idea.
    Set the ORB property com.sun.CORBA.transport.ORBTCPReadTimeouts as a colon-separated list W:G:M:F, where:
    
    W: initial wait time
    G: maximum wait time while reading giop header
    M: maximum wait time while reading message
    F: initial backoff factor.
    
    Default is 100:300:3000:20. Everything is in milliseconds.
    So the total timeout appears to be 3400 milliseconds.

    NB it's an ORB property not a system property.
  • 2. Re: Sun corba service set time out
    937996 Newbie
    Currently Being Moderated
    Thanks a lot for your reply, I guess im kinda confusing. Maybe you can help me and enlighten me a bit. my problem here is i need to set timeout. With weblogic default timeout. THe time out is actually not consistence, from 0- 50 minute.

    below is my snippet of code.
    If im not setting any properties or system variable then the system will run default


    code set 1.
    myOrb = org.omg.CORBA.ORB.init(args, null);
    System.out.println("After System org.omg.CORBA.ORBClass:"+System.getProperty("org.omg.CORBA.ORBClass"));
    System.out.println("After System org.omg.CORBA.ORBSingletonClass:"+System.getProperty("org.omg.CORBA.ORBSingletonClass"));

    -- print line result.
    After System org.omg.CORBA.ORBClass:weblogic.corba.orb.ORB
    After System org.omg.CORBA.ORBSingletonClass:weblogic.corba.orb.ORB


    it still print weblogic.
    code set 2.
    Properties prop = new Properties();     
    prop.put("org.omg.CORBA.ORBClass", "com.sun.corba.se.impl.orb.ORBImpl");
    prop.put("org.omg.CORBA.ORBSingletonClass", "com.sun.corba.se.impl.orb.ORBSingleton");
    //prop.put("com.sun.CORBA.transport.ORBTCPReadTimeouts);
    myOrb = org.omg.CORBA.ORB.init(args, prop);

    -- print line result.
    After System org.omg.CORBA.ORBClass:weblogic.corba.orb.ORB
    After System org.omg.CORBA.ORBSingletonClass:weblogic.corba.orb.ORB
  • 3. Re: Sun corba service set time out
    937996 Newbie
    Currently Being Moderated
    By the way Im using weblogic server 10.3
  • 4. Re: Sun corba service set time out
    EJP Guru
    Currently Being Moderated
    What part of my answer didn't you understand?

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points