[omniORB] Weird behavior with omniORBpy 1.x and ServantLocators
Duncan Grisby
dgrisby@uk.research.att.com
Thu, 09 Aug 2001 10:03:33 +0100
On Wednesday 8 August, John D. Heintz wrote:
> In the sample code below we will get:
> AttributeError: "None" object has no attribute "doSomething"
>
> Does anyone have any idea? Are we doing something wrong?
The problem is that the POA does nothing to prevent concurrent calls
to your ServantLocator and servant. You have a race condition where
two threads can come in at roughly the same time. The first thread
calls postinvoke() and clears the DomainObject before the second
thread gets to invoke the servant's method.
You need to implement some sort of concurrency control. Note that
using a single thread policy POA is not sufficient, since the three
calls preinvoke(), servant method, postinvoke() are separate calls --
other calls can occur between them.
Cheers,
Duncan.
--
-- Duncan Grisby \ Research Engineer --
-- AT&T Laboratories Cambridge --
-- http://www.uk.research.att.com/~dpg1 --