[omniORB] Problems registering names in omniORB

Tuyen Chau tchau at verano.com
Fri Jan 12 08:53:00 GMT 2007


José Felix wrote:
> Hi, everbody
> I neeed some instruction about the implementation of omniORB 4.0. In
> this project we use Windows and Visual Studio C++ Express.
> If the server where omniNames.exe is running gets down, the
> application must not stop. We have to find a way of having the server
> replicated locally in each machine, or to make the components
> registered in the environment that stop be able to register in a local
> environment.
> OmniORB doesn't seen to let this happen. Once we bind the object to a
> certain name in the CORBA environment, even changing the server name
> in the windows registry doesn't work to change the server while the
> application is running. We have to restart the application for this
> strategy to work.
> Alternatively, I have read somewhere that IMR could help me doing
> similar stuff, but I don't find much information about it. Can
> somebody help me?
>
> Thanks in advance,
I may have misunderstood your requirements but if you want to 
dynamically change the DefaultInitRef parameter in order to connect to a 
different omniNames, you can use the internal function setFromFile().  
Here's how we use it to talk to differerent omniNames.  We don't even 
need to specify DefaultInitRef in the registry or the omniORB config file.

    // Set up the name to find the NameService.  This is actually an
    // internal call we discovered from looking around the omniORB code.
    sprintf(corbaName, "corbaname::%s", hostName);
    omni::omniInitialReferences::setFromFile("NameService", corbaName);

    // Obtain a reference to the root context of the Name service
    obj = orb->resolve_initial_references("NameService");

    // Narrow the reference returned.
    rootContext = CosNaming::NamingContext::_narrow(obj);
   
Hope this helps,
Tuyen



More information about the omniORB-list mailing list