<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<meta name=Generator content="Microsoft Word 11 (filtered medium)">
<!--[if !mso]>
<style>
v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style>
<![endif]-->
<title>Persistent CORBA objects</title>
<style>
<!--
/* Font Definitions */
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman";}
a:link, span.MsoHyperlink
        {color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {color:purple;
        text-decoration:underline;}
p
        {mso-margin-top-alt:auto;
        margin-right:0cm;
        mso-margin-bottom-alt:auto;
        margin-left:0cm;
        font-size:12.0pt;
        font-family:"Times New Roman";}
span.E-MailFormatvorlage18
        {mso-style-type:personal-reply;
        font-family:Arial;
        color:navy;}
@page Section1
        {size:595.3pt 841.9pt;
        margin:70.85pt 70.85pt 2.0cm 70.85pt;}
div.Section1
        {page:Section1;}
-->
</style>
</head>
<body lang=DE link=blue vlink=purple>
<div class=Section1>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>Hi,<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span lang=EN-GB
style='font-size:10.0pt;font-family:Arial;color:navy'>creating a persistent
CORBA object usually requires setting the lifespan and id assignment policy of
the POA.<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span lang=EN-GB
style='font-size:10.0pt;font-family:Arial;color:navy'>You can either create a new
POA with the desired policies like this:<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span lang=EN-GB
style='font-size:10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=4 face="Courier New"><span
lang=EN-GB style='font-size:13.0pt;font-family:"Courier New"'>orb =
CORBA.ORB_init(sys.argv)<o:p></o:p></span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=4 face="Courier New"><span
lang=EN-GB style='font-size:13.0pt;font-family:"Courier New"'>poa =
orb.resolve_initial_references("RootPOA")<o:p></o:p></span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=4 face="Courier New"><span
lang=EN-GB style='font-size:13.0pt;font-family:"Courier New"'><o:p> </o:p></span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=4 face="Courier New"><span
lang=EN-GB style='font-size:13.0pt;font-family:"Courier New"'>policies = [
poa.create_lifespan_policy(PortableServer.PERSISTENT),<o:p></o:p></span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=4 face="Courier New"><span
lang=EN-GB style='font-size:13.0pt;font-family:"Courier New"'> poa.create_id_assignment_policy(PortableServer.USER_ID)
]<o:p></o:p></span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=4 face="Courier New"><span
lang=EN-GB style='font-size:13.0pt;font-family:"Courier New"'> <o:p></o:p></span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=4 face="Courier New"><span
lang=EN-GB style='font-size:13.0pt;font-family:"Courier New"'>poa =
poa.create_POA("MyPOA", None, policies)<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span lang=EN-GB
style='font-size:10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span lang=EN-GB
style='font-size:10.0pt;font-family:Arial;color:navy'>or use omniORB’s
special POA named “omniINSPOA” which already has these policies
set:<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span lang=EN-GB
style='font-size:10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=4 face="Courier New"><span
lang=EN-GB style='font-size:13.0pt;font-family:"Courier New"'>orb =
CORBA.ORB_init(sys.argv)<o:p></o:p></span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=4 face="Courier New"><span
lang=EN-GB style='font-size:13.0pt;font-family:"Courier New"'>poa =
orb.resolve_initial_references("omniINSPOA")<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span lang=EN-GB
style='font-size:10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span lang=EN-GB
style='font-size:10.0pt;font-family:Arial;color:navy'>When you activate the
servant in this POA you have to specify the object id:<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span lang=EN-GB
style='font-size:10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=4 face="Courier New"><span lang=EN-GB
style='font-size:13.0pt;font-family:"Courier New"'>id = "MyObjectId" <o:p></o:p></span></font></p>
<p class=MsoNormal><font size=4 face="Courier New"><span lang=EN-GB
style='font-size:13.0pt;font-family:"Courier New"'>poa.activate_object_with_id(id,
servant)</span></font><font size=2 color=navy face=Arial><span lang=EN-GB
style='font-size:10.0pt;font-family:Arial;color:navy'><o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span lang=EN-GB
style='font-size:10.0pt;font-family:Arial;color:navy'> <o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span lang=EN-GB
style='font-size:10.0pt;font-family:Arial;color:navy'>Finally you must specify
the server’s endpoint address by the –ORBendPoint parameter, like in
this example:<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span lang=EN-GB
style='font-size:10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=4 face="Courier New"><span lang=EN-GB
style='font-size:13.0pt;font-family:"Courier New"'>python MyServer.py –ORBendPoint
::localhost:5555 <o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span lang=EN-GB
style='font-size:10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span lang=EN-GB
style='font-size:10.0pt;font-family:Arial;color:navy'>The benefit of using
omniINSPOA (besides simplicity) is that your object is not only persistent, but
also supports the corbaloc object resolution scheme.<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span lang=EN-GB
style='font-size:10.0pt;font-family:Arial;color:navy'>This example object can be
resolved by:<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span lang=EN-GB
style='font-size:10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=4 face="Courier New"><span lang=EN-GB
style='font-size:13.0pt;font-family:"Courier New"'>orb.string_to_object("corbaloc:iiop:localhost:5555/MyObjectId”)<o:p></o:p></span></font></p>
<div>
<p class=MsoNormal><font size=3 face="Times New Roman"><span lang=EN-GB
style='font-size:12.0pt'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span lang=EN-GB
style='font-size:10.0pt;font-family:Arial;color:navy'>Clemens<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span lang=EN-GB
style='font-size:10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=3 face="Times New Roman"><span lang=EN-GB
style='font-size:12.0pt'><o:p> </o:p></span></font></p>
<div class=MsoNormal align=center style='text-align:center'><font size=3
face="Times New Roman"><span style='font-size:12.0pt'>
<hr size=2 width="100%" align=center tabindex=-1>
</span></font></div>
<p class=MsoNormal><b><font size=2 face=Tahoma><span style='font-size:10.0pt;
font-family:Tahoma;font-weight:bold'>Von:</span></font></b><font size=2
face=Tahoma><span style='font-size:10.0pt;font-family:Tahoma'>
omniorb-list-bounces@omniorb-support.com
[mailto:omniorb-list-bounces@omniorb-support.com] <b><span style='font-weight:
bold'>Im Auftrag von </span></b>Daschner, Stefan<br>
<b><span style='font-weight:bold'>Gesendet:</span></b> Donnerstag, 1. März 2007
11:16<br>
<b><span style='font-weight:bold'>An:</span></b>
omniorb-list@omniorb-support.com<br>
<b><span style='font-weight:bold'>Betreff:</span></b> [omniORB] Persistent
CORBA objects</span></font><o:p></o:p></p>
</div>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><o:p> </o:p></span></font></p>
<p><font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>Hello,</span></font>
<o:p></o:p></p>
<p><font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>does
anybody know how to make a CORBA object persistent ?</span></font> <br>
<font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>What I
found in the documentation is that the POA’s Lifespan Policy determines </span></font><br>
<font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>whether
objects created within it are transient or persistent.</span></font> <br>
<font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>But
how can I set the POA’s Lifespan Policy ?</span></font> <br>
<font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>I'm
using omniORBpy-3.0-rc1.</span></font> <o:p></o:p></p>
<p><font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>Thanks,
Stefan</span></font> <o:p></o:p></p>
</div>
</body>
</html>