[omniORB] Synchronized access to objects

Mike Mascari mascarm@mascari.com
Thu Mar 27 13:25:03 2003


Hello all.

I was wondering if anyone could give me some tips as to how best 
synchronize access to a session-oriented transient object?  The 
object itself maintains a connection to a database and therefore 
requires that all access to the object be serialized. I don't 
want SINGLE_THREAD_POLICY since the servant implementation 
serves more than one client simultaneously through different 
object instances. I tried using a per-object pthread mutex for 
synchronization at the entrance of every method invocation. But 
since some methods of a given object call other methods of the 
same object, I had to use PTHREAD_MUTEX_RECURSIVE to prevent 
deadlock. Nevertheless, I have encountered a problem with the 
implementation that I am only able to get working by disabling 
synchronization mechanism I had hoped to use. I was hoping 
someone would know how I might synchronize instance-specific 
calls *before* the call is dispatched to the servant?

Mike Mascari
mascarm@mascari.com