AW: [omniORB] Persistent CORBA objects

Daschner, Stefan stefan.daschner at siemens.com
Fri Mar 2 16:34:39 GMT 2007


Hi,
 
I tried your proposal with the poa child and my server is now creating always the same IOR 
for it's entry object after each restart.
Now it's not necessary anymore to transfer the IOR after each server restart to the client.  
 
Thank you very much for your help !
 
Stefan

________________________________

Von: Fischer, Clemens [mailto:clemens.fischer at atlas.de] 
Gesendet: Freitag, 2. März 2007 12:15
An: Daschner, Stefan; omniorb-list at omniorb-support.com
Betreff: AW: [omniORB] Persistent CORBA objects



Hi,

creating a persistent CORBA object usually requires setting the lifespan and id assignment policy of the POA.

You can either create a new POA with the desired policies like this:

 

orb = CORBA.ORB_init(sys.argv)

poa = orb.resolve_initial_references("RootPOA")

 

policies = [ poa.create_lifespan_policy(PortableServer.PERSISTENT),

             poa.create_id_assignment_policy(PortableServer.USER_ID) ]

             

poa = poa.create_POA("MyPOA", None, policies)

 

or use omniORB's special POA named "omniINSPOA" which already has these policies set:

 

orb = CORBA.ORB_init(sys.argv)

poa = orb.resolve_initial_references("omniINSPOA")

 

When you activate the servant in this POA you have to specify the object id:

 

id = "MyObjectId" 

poa.activate_object_with_id(id, servant)

 

Finally you must specify the server's endpoint address by the -ORBendPoint parameter, like in this example:

 

python MyServer.py -ORBendPoint ::localhost:5555 

 

The benefit of using omniINSPOA (besides simplicity) is that your object is not only persistent, but also supports the corbaloc object resolution scheme.

This example object can be resolved by:

 

orb.string_to_object("corbaloc:iiop:localhost:5555/MyObjectId")

 

Clemens

 

 

________________________________

Von: omniorb-list-bounces at omniorb-support.com [mailto:omniorb-list-bounces at omniorb-support.com] Im Auftrag von Daschner, Stefan
Gesendet: Donnerstag, 1. März 2007 11:16
An: omniorb-list at omniorb-support.com
Betreff: [omniORB] Persistent CORBA objects

 

Hello, 

does anybody know how to make a CORBA object persistent ? 
What I found in the documentation is that the POA's Lifespan Policy determines 
whether objects created within it are transient or persistent. 
But how can I set the POA's Lifespan Policy ? 
I'm using omniORBpy-3.0-rc1. 

Thanks, Stefan 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.omniorb-support.com/pipermail/omniorb-list/attachments/20070302/fd5331e3/attachment.htm


More information about the omniORB-list mailing list