specifying timeout for calls on remote CORBA objects

When using a remote CORBA object from a Java client, we make use of a periodic heartbeat call to ensure the remote object is still available.

If the process hosting the remote object dies, we get an exception back immediately after making the call which helps us to know that we need to re-connect.

If, however, the network goes down (i.e. unplug the machine running the process hosting the remote object from the network), things get a little tricker. At this point, you end up relying on the underlying socket timeouts to control how soon you'll get back an exception.

We're using both C++/TAO/ACE clients and Java clients. For the C++ clients, we noticed that the timeout value varied significantly based on operating system. For example, on Windows XP Home, it took 75 seconds to get an exception, but on Windows 2000 Pro, it only took 5 seconds.

The solution for the C++ clients was to make use of a policy override in the ORB, specifying a 5 second timeout. This resulted in a uniform timeout regardless of underlying operating system.

Now, we have to solve the same problem for the Java clients and I'm wondering if there is a similar mechanism for Sun's built-in ORB. Any ideas?

[1241 byte] By [davidcalkins] at [2007-9-30 3:24:09]
# 1
from what I can tell it looks like I should be able to use orb.create_policy(), however, I can't seem to find the documentation which explains the specific values to use for Sun's built-in ORB. Anyone have experience using this?
davidcalkins at 2007-6-29 13:56:37 > top of Java-index,Administration Tools,Sun Connection...
# 2

here's what I found out. The ORB provided by Sun doesn't appear to provide a policy manager or any other way to specify object request timeouts.

We've ended up using JacORB instead, which very easily plugs into the JDK. With JacORB, we're able to specify an object request timeout using the code below:

long objtimeout = 5; // sets a 5 second timeout

PolicyManager policyManager = PolicyManagerHelper.narrow(

orb.resolve_initial_references("ORBPolicyManager"));

Policy p = new org.jacorb.orb.policies.RelativeRoundtripTimeoutPolicy(objtimeout * 10000000);

policyManager.set_policy_overrides(new Policy[]{ p },

SetOverrideType.ADD_OVERRIDE);

davidcalkins at 2007-6-29 13:56:37 > top of Java-index,Administration Tools,Sun Connection...