[omniORB] multiple proxy factories

Renzo Tomaselli renzo.tomaselli@tecnotp.it
Fri, 31 Mar 2000 20:51:00 +0200


Hi OmniORB developers,
    I ran into a problem with 2.8 on NT I'm asking for help about.
I have an application which loads/unloads dlls, all implemented with OmniORB
as well as the loader dll. They are connected to the loader by means of a
single thin call, real communications occur through the ORB (for other
address spaces) or virtual tables (for in process calls).
Now it might happen that such dlls are designed to use common interfaces for
external objects, so that they link in the same proxy factory of them.
Say our application loads dll A first, then dll B and both contain stubs for
interface Foo. When dll B needs to instantiate Foo, the proxy factory of Foo
in A is called because it has been registered first with the factory chain
of the ORB (according to comments in objectRef.cc). The method
omni::createObjRef searches for the first factory matching a given rep. id.
If A is unloaded, any usage of Foo instances in B crashes because while they
are still on the process heap, their vftbl are gone with A (the reason for
this is still obscure, but it's what I got from MSVC 6.0 debugger).
This raises a somewhat funny behavior when a complex environment is set up
along this architecture, because the effect is very unpredicatable.
Basically it depends on loading/unloading sequences.
Since it's rather obvious that OmniORB cannot account for such ambiguities,
I'm asking:

- whether anybody can suggest a workaround without disrupting the main
architecture frame; all factories are on the chain, the point is about how
to have a further selector beyond rep.id;
- whether v 3.0 deals with proxy factories the same way.

Thanks,
                                             Renzo Tomaselli
---------------------------------------------------------------------------
TecnoTP s.n.c. Special Information System Design
Maso Pelauchi I38050 Ronchi Valsugana,  Trento TN  ITALY
Tel. +39 0461 773164      Fax. +39 0461 771514
e-mail: renzo.tomaselli@tecnotp.it
---------------------------------------------------------------------------