[Zope] DLL Release

Scheck, Herman Herman.Scheck@intp.com
Tue, 27 Nov 2001 07:43:06 -0800


Hi all,

My question is on releasing DLLs/threads used by external python methods in
Zope (ver 2.4.1).

Once a COM object (QuoteDB.dll in the following example) is accessed via an
external python method (below) and the process is completed...

----------------------
import win32com.client
import pythoncom

def GetRFQNumbers(DSN, UID, PWD):
   # retrieves request for quote numbers
   #
   # arguments:  DSN - data source name
   #             UID - data source user id
   #             PWD - data source password
   # returns  :  record tuple of rfqNumbers
   pythoncom.CoInitialize()
   QuoteDB = win32com.client.Dispatch("QuoteDB.BusinessRules")
   rfqNumbers = QuoteDB.GetRFQNumbers(DSN, UID, PWD)
   return rfqNumbers[0]
----------------------

... the DLL becomes locked until the Zope service is shut down.  Problem
here is that I do not want to have to shut down the Zope service containing
multiple applications just to replace/upgrade a single DLL used by a single
application.  Am I missing something in the python code to release the
DLL/thread before returning?  Or, is Zope maintaining the thread in some
way?  How do I programmatically kill/close the thread when it is no longer
in use?

Thanks,
-Herman