Discussion:
AW: [omniORB] Persistent CORBA objects
Fischer, Clemens
2007-03-02 17:15:24 UTC
Permalink
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-***@omniorb-support.com [mailto:omniorb-list-***@omniorb-support.com] Im Auftrag von Daschner, Stefan
Gesendet: Donnerstag, 1. M?rz 2007 11:16
An: omniorb-***@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/6243205a/attachment.htm
Daschner, Stefan
2007-03-02 21:34:32 UTC
Permalink
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:***@atlas.de]
Gesendet: Freitag, 2. M?rz 2007 12:15
An: Daschner, Stefan; omniorb-***@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-***@omniorb-support.com [mailto:omniorb-list-***@omniorb-support.com] Im Auftrag von Daschner, Stefan
Gesendet: Donnerstag, 1. M?rz 2007 11:16
An: omniorb-***@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
Daschner, Stefan
2007-03-20 15:50:21 UTC
Permalink
Hi,

is it possible to make a CORBA object persistent in such a way that after restarting the server
the client can contact the CORBA object again without restarting ?
From my interpretion of the documentation it should be possible.
What I have now is that the CORBA object is persistent only in the sense that the client can use the same IOR after server restart.
But the client cannot contact this object after server restart anymore. Even if the client performs string_to_object()
and _narrow() after server restart it gets a CORBA.COMM_FAILURE(omniORB.COMM_FAILURE_WaitingForReply, CORBA.COMPLETED_MAYBE)
when trying to call a method of the CORBA object. Only if the client destroys and reinitializes
the ORB before string_to_object() and _narrow() (or after a client restart) then it can call the method again.

Can anybody help me ?

Thanks,
Stefan

________________________________

Von: omniorb-list-***@omniorb-support.com [mailto:omniorb-list-***@omniorb-support.com] Im Auftrag von Daschner, Stefan
Gesendet: Freitag, 2. M?rz 2007 16:35
An: Fischer, Clemens; omniorb-***@omniorb-support.com
Betreff: AW: [omniORB] Persistent CORBA objects


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:***@atlas.de]
Gesendet: Freitag, 2. M?rz 2007 12:15
An: Daschner, Stefan; omniorb-***@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-***@omniorb-support.com [mailto:omniorb-list-***@omniorb-support.com] Im Auftrag von Daschner, Stefan
Gesendet: Donnerstag, 1. M?rz 2007 11:16
An: omniorb-***@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/20070320/9e21a561/attachment-0001.htm
Loading...