Re: CoInitialize failure with many processes
- From: "Paul Baker [MVP, Windows Desktop Experience]" <paulrichardbaker@xxxxxxxxxxxxxxxx>
- Date: Thu, 2 Apr 2009 15:40:41 -0400
Is this typical of each of the hundreds of processes? So it is using ADO to
connect to a SQL Server?
I could not find a good reference about ADO connection pooling, but I
believe the pool is process specific. In other words, each process will get
its own connection to the SQL Server. I can see how having hundreds of
simultaneous connections to a SQL Server might be a bad idea.
"netstat -o" at the Command Prompt will reveal what is going on with TCP
connections in practice. You can try different parameters to get whatever
information you want.
I would think some more about how you might reengineer this a bit without
using up too much time that you don't have.
Paul
"Dan" <Dan@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:BE92EC61-A5B2-4D2F-845F-BCEC7BE6D8B3@xxxxxxxxxxxxxxxx
Brian,
As I continue to dig through this code, it appears that it is using COM to
directly communicate with the SQL server. I'm learning as I go here.
Prior to calling CoInitialize(NULL), there is nothing done of interest.
(e.g. Setting thread priority, parsing command line arguments, etc) After
the CoInitialize, the connection is made using a msado15.tlh file and a
_connection object (apparently an ADO object, or ActiveX Data Object).
CreateInstance is called on a _ConnectionPtr object, then Open is called
on
this object with the following connection string:
"Provider=sqloledb;Server=%*.*S%S%*.*S;Database=%*.*S%SSystem;Trusted_Connection=Yes;"
The resulting object is returned as a _variant_t object casted from an
(IUnknown*) pointer. This variant object is passed into a _RecordsetPtr
object's Open function along with an SQL statement casted as a _variant_t
object as well.
Regarding the Performance Monitor, I haven't seen anything out of the
ordinary. What performance objects and counters should I be looking at?
Thanks,
Dan
"Brian Muth" wrote:
Ok, forget trying to create winstations. Kick your co-worker in the pants
for wasting your time.
Can you please clarify the picture for me. You are trying to create
hundreds
of processes. Each process is instantiating a COM object. So, is the COM
server a DLL or a separate executable? Is it a simple COM object or a
full-blown ActiveX control? Was it developed in MFC or ATL? What
resources
does it use?
Please try to answer as many of these questions as you can. And did you
run
performance monitor yet as advised?
Brian
.
- Follow-Ups:
- References:
- CoInitialize failure with many processes
- From: Dan
- RE: CoInitialize failure with many processes
- From: Dan
- Re: CoInitialize failure with many processes
- From: Brian Muth
- Re: CoInitialize failure with many processes
- From: Brian Muth
- Re: CoInitialize failure with many processes
- From: Dan
- CoInitialize failure with many processes
- Prev by Date: Re: CoInitialize failure with many processes
- Next by Date: Re: CoInitialize failure with many processes
- Previous by thread: Re: CoInitialize failure with many processes
- Next by thread: Re: CoInitialize failure with many processes
- Index(es):
Relevant Pages
|
Loading