COM server info

Alex Martelli aleaxit at yahoo.com
Thu Feb 15 23:23:14 CET 2001


"Adolfo Benin" <adolfo.benin at riskmap.it> wrote in message
news:mailman.982263496.7413.python-list at python.org...
> Hi,
> I've developed a COM object in Python, then I regitered it as a DCOM on my
> machine.
> Every time a client makes a request to the server DCOM, the Python
> interpreter is launched and the COM is created. But when the client ends,
> the COM server also ends.
> So every call to the server creates a new python interpreter instance in
> memory!
>
> Is there a way to keep the COM server alive using always the same COM
> object instance?
> I have already performed this task succesfully using CORBA (single servant
> CORBA object), but I need to expose the server as a COM object too.
>
> Have you got any suggestion?

There are several approaches.  My suggestion is to eschew the
'singleton' design pattern: let however many COM objects the
clients wish be created, each with its own natural identity; they
can delegate everything to a single 'internal' COM object they
in turn create (which can, e.g., RegisterActiveObject itself with
ACTIVEOBJECT_STRONG to keep the process alive).  Using NT
Servers is also good in a similar approach.


Alex






More information about the Python-list mailing list