wboatrupusvjuadgwbchdelaruecom thank rober alex answers must admit im still bit uncertain whole issue understood apache creating thread every request anyway yes windows mpm winnt used wouldnt enough call coinitialized start mod_python pythonhandler counitialize end handler try finally added case script would crash right counitialize called case well idea single thread queue dont really get honest sort object would passed queue would create queue thread guess thinking standard python modules theres probably python module everything greetings dominique ________________________________________ von robert brewer rsgairznaminusorg gesendet donnerstag 24 april 2008 1757 holzwarth dominique berne bauhaus kpitckaew45pythonorg betreff pythonwin32 apache mod_python win32com wboatrupusvjuadgwbchdelaruecom wrote im developing web application using mod_python apache web server application handle xml files im using win32com msxml problem apache spawns new process thread sure wether ist process thread think thread windows almost certainly thread apache windows uses winnt mpm multithreaded multiprocess per http request multiple users generated requests time new request first one returned multiple threads running thats win32com code crashing currently every request code following example return win32comclientdispatchmsxml2domdocument60 get empty msxsml dom object multiple requests time get following error file cprogram filesapache software foundationapache22tcrexceptionmanagerdatadatabase_librarydatabase py line 24 __init__ self__configfileschema self__xsdschemacache file cprogram filesapache software foundationapache22tcrexceptionmanagerdatadatabase_librarydatabase py line 1774 __xsdschemacache return win32comclientdispatchmsxml2xmlschemacache60 file cprogram filespython25libsite packageswin32comclient__init__py line 95 dispatch dispatch username dynamic_getgooddispatchandusernamedispatchusernameclsctx file cprogram filespython25libsite packageswin32comclientdynamicpy line 98 _getgooddispatchandusername return _getgooddispatchidispatch clsctx username file cprogram filespython25libsite packageswin32comclientdynamicpy line 78 _getgooddispatch idispatch pythoncomcocreateinstanceidispatch none clsctx pythoncomiid_idispatch com_error 2147221008 coinitialize called none none ive read already bit mailing list someone mentioned one need call pythoncomcoinitialize pythoncomcouninitialize dont know exactly call functions wether thatll solve problem also import win32compythoncom get error module pythoncom exist would really happy someone could help tell make win32com work multiple threads alex mentioned need call coinitialize thread unfortunately since apache creating threads dont hook events run thread startup instead watch threads go call coinitialize asap best tryfinally case something goes wrong def handlerreq coinitialize try processreq return apacheok finally couninitialize various reasons cant made work components arent thread safe another option would run com calls single thread use queue request threads would call qputxml reqid block com thread would call qget work shove result resultsreqid robert brewer rsgairznaminusorg _______________________________________________ pythonwin32 mailing list kpitckaew45pythonorg httpmailpythonorgmailmanlistinfopythonwin32 fri 08 aug 2008 002219 0100 pythonwin32 apache mod_python win32com