Persistent Objects

Sai-Lai Lo S.Lo@orl.co.uk
Thu, 5 Jun 1997 14:33:19 +0100


>>>>> Edward Scott writes:

> Does anyone have an example of creating persistent objects using
> omniOrb? The ability to do this is mention in section 2.8.4 of the
> manual. I guess I am looking for the equivalent of object Loaders in
> Orbix.

omniNames uses the feature to create "persistent" objects. These objects
can be contacted using the same IOR when they are instantiated in different
program runs. 

Basically, there are two things you need to do:

1. Make sure that the BOA uses the same port to accept incoming IIOP
   connections. This is done by passing the 
        -BOAiiop_port <port number> 
   to BOA::init(). 
   See section 3.1 of the user guide and the ORB initialisation chapter of
   the CORBA spec for details.

2. Make sure that the same object key is used to identify the object 
   implementation. omniORB provides a ctor in the implementation skeleton
   class that takes an object key as an argument and uses that to identify
   the object (section 2.4.2 of the user guide). The object key is an
   opaque type but can be converted to and from a sequence of octets
   using the utility functions described in section 3.3 of the user guide.

   As an example, have a look at omniNames. I suggest you starts with
   void log::getCreate(istream& file) (line 648, src/appl/omniNames/log.cc).


Have fun.

Sai-Lai Lo

-- 
E-mail:         S.Lo@orl.co.uk          |       Olivetti & Oracle Research Lab
                                        |       24a Trumpington Street
Tel:            +44 223 343000          |       Cambridge CB2 1QA
Fax:            +44 223 313542          |       ENGLAND