Re: Windows Service & ADO problem
- From: "Guillem" <guillemvicens-nospam@xxxxxxxxxxxxxxxxxx>
- Date: 20 Sep 2006 07:58:56 -0700
Allen wrote:
Thanks for the thoughts, however the problem occurs on machines
without iLO cards too. I reviewing the detailed logging that I have
incorporated this OS corruption only occurs when the service stop code
that includes the call to CoUninitialize is never called.
ah, it seems we are narrowing this down... maybe the problem is not the
unfreed components.
As ADO is based on COM it needs to call coInitialize to initialize its
library for the current thread. Well, actually Microsoft recommends to
skip coInitialize and use coInitializeEx instead so that you can
specify the concurrency model.
Anyway, if you don't call coUninitialize there is a lot of things not
done. As stated in MSDN:
[coUninitialize] "Closes the COM library on the current thread, unloads
all DLLs loaded by the thread, frees any other resources that the
thread maintains, and forces all RPC connections on the thread to close"
It also may be a problem with MDAC or COM corruption/bug. There is an
MDAC component checker:
http://msdn.microsoft.com/data/ref/mdac/downloads/
Don't know if there is anything similar for COM. I would also recommend
to check if you have the latest MDAC version.
silly question but is there a way to ensure that a particular service
is shut down before all others in the OS? maybe some dependency or
another?
if the OS is closed gracefully you can make your app react to close
messages from the system and free/unload anything you need. However you
won't have direct control over it. If the OS simply dies because the
power is gone not AFAIK
--
Best regards :)
Guillem Vicens Meier
Dep. Informática Green Service S.A.
www.clubgreenoasis.com
--
Contribute to the Indy Docs project: http://docs.indyproject.org
--
In order to contact me remove the -nospam
.
- References:
- Windows Service & ADO problem
- From: Allen
- Re: Windows Service & ADO problem
- From: Guillem
- Re: Windows Service & ADO problem
- From: Allen
- Re: Windows Service & ADO problem
- From: Guillem
- Re: Windows Service & ADO problem
- From: Allen
- Windows Service & ADO problem
- Prev by Date: Re: Boolean field in MS Access
- Next by Date: Delphi 6 - ADO - MS SQL Server
- Previous by thread: Re: Windows Service & ADO problem
- Next by thread: Manipulate Schema before SafeToFile(XML)
- Index(es):
Relevant Pages
|