[omniORB] problem with insPOA and Factory object
Duncan Grisby
dgrisby@uk.research.att.com
Mon, 29 Jan 2001 11:35:19 +0000
On Tuesday 23 January, =?iso-8859-1?Q?Juan_Carlos_Coru=F1a?= wrote:
> I try to implement a Factory object to create instances of another
> object, but without success.
[...]
> class MQ_Factory_i(MQ_module__POA.MQ_Factory):
> def create_MQ(self):
> print 'creating MQ'
> mq = MQ_class_i()
> return mq._this()
[...]
> The problem appears here in the last line ("session =
> mq_jcoruna.Login('jcoruna')"). The system doesn't return any value and
> waits until timeout. The system works correctly without the Factory.
The problem is that your MQ_class object has been activated in the
Root POA, because of the implicit activation on the call to _this().
You haven't activated the Root POA, so requests to the MQ_class object
are blocked.
That is why implicit activation is evil. It is better to explicitly
activate your objects in the POA you want them in, and avoid the use
of _this().
Cheers,
Duncan.
--
-- Duncan Grisby \ Research Engineer --
-- AT&T Laboratories Cambridge --
-- http://www.uk.research.att.com/~dpg1 --