<div><div>Hello,<br>
Thanks for the replies.<br><br>
</div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">I
am working on a quite similar application, and I think the pattern is
very common. In my case there are a number of methods on the processor
object that the client can call. Therefore I have added a close()
method so that the client can signal when the object is no longer
needed. In the close() function I call poa->deactivate_object() but
this does not deactivate the object straight away nor does it delete
the servant!</blockquote><div>Not?
deactivate_object() says to the POA, that the servant should be
destroyed. It waits until the servant finishes its jobs, and then
deactivates and deletes the servant. So are you sure about that in your
app?<br>
Here is a dump of mine:<br>
app: Finish method started.<br>
omniORB: State root<1> (active) -> deactivating<br>
omniORB: Object is still busy -- etherealise later.<br>
app: Finish method finished<br>
omniORB: sendChunk: to giop:tcp:<a href="http://10.0.0.10:42682">10.0.0.10:42682</a> 24 bytes<br>
omniORB: POA(RootPOA) etherealising object root<1> (deactivating).<br>
id: IDL:root/Generator:1.0<br>
omniORB: State root<1> (deactivating) -> etherealising<br>
omniORB: Removing root<1> (etherealising) from object table<br>
omniORB: Object table entry root<1> (dead) deleted.<br>
omniORB: RefCountServantBase has zero ref count -- deleted.<br>
app: destructor invoked, got dead<br>
<br>
So it is deleted right, deactivation decreases the ref_count, so the
_remove_ref() should not be invoked, just after the activation.<br>
I just wanted to do this without an additional method. I just wanted to automate this process.<br>
(As it is in EJB3 for example) </div><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"> To my knowledge there are two possibilities for servant deletion:
<br>
</blockquote><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">(a)
Use a ServantActivator POA for the activation of servants - its method
etherealize() will be called when the object is no longer in use. This
pattern is well described in [Bolton, Pure Corba].</blockquote><div><br>Yes
I thought something similar to this, is this complex very much? This
would eliminate the additional close/remove method. If yes, maybe the
efforts do not worth the time. <br>
</div><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">(b)
Derive your servant from RefCountServantBase and call _remove_ref()
after poa->deactivate_object(). I have made some tests and up to now
the object gets properly destructed in all cases. Perhaps somebody can
confirm that this is a safe way to proceed.</blockquote><div>This
should not be used, because the _remove_ref() decreases immediatelly
the ref_count, and the object is still busy, as we invoked this things
from its method, and it hasnt returned. So if you use _remove_ref, the
deletion will be faster than the deactivation and you will get
exceptions, so the remove is not clear, and poa can deactivate nothing
as the object is already deleted.<br>
Correct me if I am mistaken.<br>
<br>
</div></div>I will check the ServantActivator POA, I hope it is not too complex:) Does anybody have some experiences with it?<br>
Thanks again, Attila<br>