<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML xmlns="http://www.w3.org/TR/REC-html40" xmlns:v =
"urn:schemas-microsoft-com:vml" xmlns:o =
"urn:schemas-microsoft-com:office:office" xmlns:w =
"urn:schemas-microsoft-com:office:word"><HEAD><TITLE>Persistent CORBA objects</TITLE>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2900.3059" name=GENERATOR><!--[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]-->
<STYLE>@font-face {
        font-family: Tahoma;
}
@page Section1 {size: 595.3pt 841.9pt; margin: 70.85pt 70.85pt 2.0cm 70.85pt; }
P.MsoNormal {
        FONT-SIZE: 12pt; MARGIN: 0cm 0cm 0pt; FONT-FAMILY: "Times New Roman"
}
LI.MsoNormal {
        FONT-SIZE: 12pt; MARGIN: 0cm 0cm 0pt; FONT-FAMILY: "Times New Roman"
}
DIV.MsoNormal {
        FONT-SIZE: 12pt; MARGIN: 0cm 0cm 0pt; FONT-FAMILY: "Times New Roman"
}
A:link {
        COLOR: blue; TEXT-DECORATION: underline
}
SPAN.MsoHyperlink {
        COLOR: blue; TEXT-DECORATION: underline
}
A:visited {
        COLOR: purple; TEXT-DECORATION: underline
}
SPAN.MsoHyperlinkFollowed {
        COLOR: purple; TEXT-DECORATION: underline
}
P {
        FONT-SIZE: 12pt; MARGIN-LEFT: 0cm; MARGIN-RIGHT: 0cm; FONT-FAMILY: "Times New Roman"; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto
}
SPAN.E-MailFormatvorlage18 {
        COLOR: navy; FONT-FAMILY: Arial; mso-style-type: personal-reply
}
DIV.Section1 {
        page: Section1
}
</STYLE>
</HEAD>
<BODY lang=DE vLink=purple link=blue>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN
class=121292909-20032007>Hi,</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN
class=121292909-20032007></SPAN></FONT> </DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN
class=121292909-20032007>is it possible to make a CORBA object persistent
in such a way that after restarting the
server</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN
class=121292909-20032007>the client can contact the CORBA object again
without restarting ?</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN
class=121292909-20032007>From my interpretion of the documentation it
should be possible.</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN
class=121292909-20032007></SPAN></FONT> </DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN
class=121292909-20032007>What I have now is that the CORBA object is
persistent only in the sense that the client can use the same
</SPAN></FONT><FONT face=Arial color=#0000ff size=2><SPAN
class=121292909-20032007>IOR after server restart.</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN
class=121292909-20032007>But the client cannot contact this object after
server restart anymore. Even if the client performs string_to_object()
</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN
class=121292909-20032007>and _narrow() after server restart it gets a
</SPAN></FONT><FONT face=Arial color=#0000ff size=2><SPAN
class=121292909-20032007>CORBA.COMM_FAILURE(omniORB.COMM_FAILURE_WaitingForReply,
CORBA.COMPLETED_MAYBE)</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN
class=121292909-20032007>when trying to call a method of the CORBA object.
Only if the client destroys and reinitializes</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN
class=121292909-20032007>the ORB before string_to_object() and
_narrow() (or after a client restart) then it can call the method
again. </SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN
class=121292909-20032007></SPAN></FONT> </DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN
class=121292909-20032007>Can anybody help me ? </SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN
class=121292909-20032007></SPAN></FONT> </DIV>
<DIV dir=ltr align=left><SPAN class=121292909-20032007></SPAN><FONT
face=Arial><FONT color=#0000ff><FONT size=2>T<SPAN
class=121292909-20032007>hanks,</SPAN></FONT></FONT></FONT></DIV>
<DIV dir=ltr align=left><FONT><FONT color=#0000ff><FONT size=2><SPAN
class=121292909-20032007></SPAN></FONT></FONT></FONT><SPAN
class=121292909-20032007></SPAN><FONT face=Arial><FONT color=#0000ff><FONT
size=2>S<SPAN
class=121292909-20032007>tefan</SPAN></FONT></FONT></FONT><BR></DIV>
<DIV class=OutlookMessageHeader lang=de dir=ltr align=left>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>Von:</B> omniorb-list-bounces@omniorb-support.com
[mailto:omniorb-list-bounces@omniorb-support.com] <B>Im Auftrag von
</B>Daschner, Stefan<BR><B>Gesendet:</B> Freitag, 2. März 2007
16:35<BR><B>An:</B> Fischer, Clemens;
omniorb-list@omniorb-support.com<BR><B>Betreff:</B> AW: [omniORB] Persistent
CORBA objects<BR></FONT><BR></DIV>
<DIV></DIV>
<DIV><FONT face=Arial><FONT color=#0000ff><FONT size=2><SPAN
class=900161715-02032007>Hi,</SPAN></FONT></FONT></FONT></DIV>
<DIV><FONT face=Arial><FONT color=#0000ff><FONT size=2><SPAN
class=900161715-02032007></SPAN></FONT></FONT></FONT> </DIV>
<DIV><FONT face=Arial><FONT color=#0000ff><FONT size=2><SPAN
class=900161715-02032007>I tried your proposal with the poa child and my server
is now creating always the same IOR </SPAN></FONT></FONT></FONT></DIV>
<DIV><FONT face=Arial><FONT color=#0000ff><FONT size=2><SPAN
class=900161715-02032007>for it's entry object after
each restart.</SPAN></FONT></FONT></FONT></DIV>
<DIV><FONT face=Arial><FONT color=#0000ff><FONT size=2><SPAN
class=900161715-02032007>Now it's not necessary anymore to transfer the IOR
after each server restart to the
client. </SPAN></FONT></FONT></FONT></DIV>
<DIV><FONT face=Arial><FONT color=#0000ff><FONT size=2><SPAN
class=900161715-02032007></SPAN></FONT></FONT></FONT> </DIV>
<DIV><SPAN class=900161715-02032007>
<DIV><SPAN class=900161715-02032007></SPAN><FONT color=#0000ff><FONT face=Arial
size=2>Thank you very much for your help !</FONT></FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><SPAN class=900161715-02032007><FONT face=Arial color=#0000ff
size=2>Stefan</FONT></SPAN></DIV></SPAN></DIV>
<DIV><BR></DIV>
<DIV class=OutlookMessageHeader lang=de dir=ltr align=left>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>Von:</B> Fischer, Clemens
[mailto:clemens.fischer@atlas.de] <BR><B>Gesendet:</B> Freitag, 2. März 2007
12:15<BR><B>An:</B> Daschner, Stefan;
omniorb-list@omniorb-support.com<BR><B>Betreff:</B> AW: [omniORB] Persistent
CORBA objects<BR></FONT><BR></DIV>
<DIV></DIV>
<DIV class=Section1>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">Hi,<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN lang=EN-GB
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">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 face=Arial color=navy size=2><SPAN lang=EN-GB
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">You can either create a
new POA with the desired policies like this:<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN lang=EN-GB
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"><o:p> </o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face="Courier New" size=4><SPAN lang=EN-GB
style="FONT-SIZE: 13pt; FONT-FAMILY: 'Courier New'">orb =
CORBA.ORB_init(sys.argv)<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face="Courier New" size=4><SPAN lang=EN-GB
style="FONT-SIZE: 13pt; FONT-FAMILY: 'Courier New'">poa =
orb.resolve_initial_references("RootPOA")<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face="Courier New" size=4><SPAN lang=EN-GB
style="FONT-SIZE: 13pt; FONT-FAMILY: 'Courier New'"><o:p> </o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face="Courier New" size=4><SPAN lang=EN-GB
style="FONT-SIZE: 13pt; FONT-FAMILY: 'Courier New'">policies = [
poa.create_lifespan_policy(PortableServer.PERSISTENT),<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face="Courier New" size=4><SPAN lang=EN-GB
style="FONT-SIZE: 13pt; FONT-FAMILY: 'Courier New'">
poa.create_id_assignment_policy(PortableServer.USER_ID)
]<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face="Courier New" size=4><SPAN lang=EN-GB
style="FONT-SIZE: 13pt; FONT-FAMILY: 'Courier New'">
<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face="Courier New" size=4><SPAN lang=EN-GB
style="FONT-SIZE: 13pt; FONT-FAMILY: 'Courier New'">poa =
poa.create_POA("MyPOA", None, policies)<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN lang=EN-GB
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"><o:p> </o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN lang=EN-GB
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">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 face=Arial color=navy size=2><SPAN lang=EN-GB
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"><o:p> </o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face="Courier New" size=4><SPAN lang=EN-GB
style="FONT-SIZE: 13pt; FONT-FAMILY: 'Courier New'">orb =
CORBA.ORB_init(sys.argv)<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face="Courier New" size=4><SPAN lang=EN-GB
style="FONT-SIZE: 13pt; FONT-FAMILY: 'Courier New'">poa =
orb.resolve_initial_references("omniINSPOA")<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN lang=EN-GB
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"><o:p> </o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN lang=EN-GB
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">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 face=Arial color=navy size=2><SPAN lang=EN-GB
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"><o:p> </o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face="Courier New" size=4><SPAN lang=EN-GB
style="FONT-SIZE: 13pt; FONT-FAMILY: 'Courier New'">id = "MyObjectId"
<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face="Courier New" size=4><SPAN lang=EN-GB
style="FONT-SIZE: 13pt; FONT-FAMILY: 'Courier New'">poa.activate_object_with_id(id,
servant)</SPAN></FONT><FONT face=Arial color=navy size=2><SPAN lang=EN-GB
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"><o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN lang=EN-GB
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"> <o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN lang=EN-GB
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">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 face=Arial color=navy size=2><SPAN lang=EN-GB
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"><o:p> </o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face="Courier New" size=4><SPAN lang=EN-GB
style="FONT-SIZE: 13pt; FONT-FAMILY: 'Courier New'">python MyServer.py
–ORBendPoint ::localhost:5555 <o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN lang=EN-GB
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"><o:p> </o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN lang=EN-GB
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">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 face=Arial color=navy size=2><SPAN lang=EN-GB
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">This example object can
be resolved by:<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN lang=EN-GB
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"><o:p> </o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face="Courier New" size=4><SPAN lang=EN-GB
style="FONT-SIZE: 13pt; 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 face="Times New Roman" size=3><SPAN lang=EN-GB
style="FONT-SIZE: 12pt"><o:p> </o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN lang=EN-GB
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">Clemens<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN lang=EN-GB
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"><o:p> </o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face="Times New Roman" size=3><SPAN lang=EN-GB
style="FONT-SIZE: 12pt"><o:p> </o:p></SPAN></FONT></P>
<DIV class=MsoNormal style="TEXT-ALIGN: center" align=center><FONT
face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt">
<HR tabIndex=-1 align=center width="100%" SIZE=2>
</SPAN></FONT></DIV>
<P class=MsoNormal><B><FONT face=Tahoma size=2><SPAN
style="FONT-WEIGHT: bold; FONT-SIZE: 10pt; FONT-FAMILY: Tahoma">Von:</SPAN></FONT></B><FONT
face=Tahoma size=2><SPAN style="FONT-SIZE: 10pt; 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 face="Times New Roman" size=3><SPAN
style="FONT-SIZE: 12pt"><o:p> </o:p></SPAN></FONT></P>
<P><FONT face=Arial size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Hello,</SPAN></FONT> <o:p></o:p></P>
<P><FONT face=Arial size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">does anybody know how to make a
CORBA object persistent ?</SPAN></FONT> <BR><FONT face=Arial size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">What I found in the documentation is
that the POA’s Lifespan Policy determines </SPAN></FONT><BR><FONT face=Arial
size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">whether objects created
within it are transient or persistent.</SPAN></FONT> <BR><FONT face=Arial
size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">But how can I set the
POA’s Lifespan Policy ?</SPAN></FONT> <BR><FONT face=Arial size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">I'm using
omniORBpy-3.0-rc1.</SPAN></FONT> <o:p></o:p></P>
<P><FONT face=Arial size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Thanks, Stefan</SPAN></FONT>
<o:p></o:p></P></DIV></BODY></HTML>