<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="Generator" CONTENT="MS Exchange Server version 6.0.4630.0">
<TITLE>Deactivating/reactivating servant vs IOR.</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/rtf format -->
<P><FONT SIZE=2 FACE="Arial">Hi all,</FONT>
</P>
<P><FONT SIZE=2 FACE="Arial">A simple question:</FONT>
</P>
<P><FONT SIZE=2 FACE="Arial">- Do a servant IOR change when deactivating then reactivating it ?</FONT>
</P>
<BR>
<BR>
<P><FONT SIZE=2 FACE="Arial">Suppose you have a servant activated with a client connected to it. The client previously locate the servant using the NameService and narrow the IOR to a a proxy object (all works fine).</FONT></P>
<P><FONT SIZE=2 FACE="Arial">The server decide to deactivate the servant </FONT>
</P>
<UL>
<P><FONT SIZE=2 FACE="Courier New">PortableServer::ObjectId_var id = root_poa->servant_to_id(mServant); </FONT>
<BR><FONT SIZE=2 FACE="Courier New">root_poa->deactivate_object(id);</FONT>
</P>
</UL>
<P><FONT SIZE=2 FACE="Arial">If the clients make a call to the servant it will catch a OBJECT_NOT_EXIST exception; that is fine too.</FONT>
</P>
<P><FONT SIZE=2 FACE="Arial">So now, the server reactivate the (same) servant:</FONT>
</P>
<UL>
<P><FONT SIZE=2 FACE="Courier New">root_poa->activate_object(mServant);</FONT>
</P>
</UL>
<P><FONT SIZE=2 FACE="Arial">And the client tries again to make a call to this servant and still catch a OBJECT_NOT_EXIST exception.</FONT>
</P>
<P><FONT SIZE=2 FACE="Arial">If I reconnect from scratch</FONT>
</P>
<UL>
<P><FONT SIZE=2 FACE="Courier New">CORBA::Object_ptr p = m_NSRootContext->resolve(nsName);</FONT>
<BR><FONT SIZE=2 FACE="Courier New">MyInterfaceObj = MyInterface::_narrow(p);</FONT>
</P>
<BR>
</UL>
<P><FONT SIZE=2 FACE="Arial">It works !</FONT>
</P>
<P><FONT SIZE=2 FACE="Arial">So is it possible to reinitialize an existing client proxy obj to a reactivated servant channel without having to reconnect using the IOR… ?</FONT></P>
<P><FONT SIZE=2 FACE="Arial">Client side, I try to re _narrow </FONT> <FONT SIZE=2 FACE="Courier New">MyInterfaceObj</FONT> <FONT SIZE=2 FACE="Arial"> but it didn't work.</FONT>
</P>
<BR>
<P><FONT SIZE=2 FACE="Arial">Thanks for any idea.</FONT>
</P>
<P><FONT SIZE=2 FACE="Arial">Fred</FONT>
</P>
<P><FONT SIZE=2 FACE="Arial"> </FONT>
<BR><FONT SIZE=2 FACE="Courier New"> (</FONT>
<BR><FONT SIZE=2 FACE="Courier New"> <B></B></FONT><B> <FONT FACE="Courier New">Frédéric Prin</FONT></B><FONT SIZE=2 FACE="Courier New"> )</FONT>
<BR><FONT SIZE=2 FACE="Courier New"> Senior Software Engineer /</FONT>
<BR><FONT SIZE=2 FACE="Courier New"> S I L V A C O (</FONT>
<BR><FONT SIZE=2 FACE="Courier New"> Grenoble REsearch CEnter \</FONT>
<BR><FONT SIZE=2 FACE="Courier New"> Tel 04 56 38 10 33 )</FONT>
<BR><FONT SIZE=2 FACE="Courier New"> __________________________/___</FONT>
<BR><FONT SIZE=2 FACE="Courier New"> /__/__/__/__/__/__/__/__/__/__/</FONT>
<BR><FONT SIZE=2 FACE="Courier New"> /__/__/__/__/__/__/__/__/_____/</FONT>
<BR><FONT SIZE=2 FACE="Courier New"> /__/__/__/__/__/__/__/__/__/__/</FONT>
</P>
</BODY>
</HTML>