free threaded ATL, MTS, ADO problem 
Author Message
 free threaded ATL, MTS, ADO problem

Hi all,

I created two free threaded ATL COM objects (one call manager, another call
staff) using VC++ 6 with SP3.  manager creates and instance of staff, the
staff retrieves an ADO (2.1) recordset using adAsyncFetch | adAsyncExecute.
Before Open is called on the recordset pointer, I set CursorLocation =
adUseClient, then set Properties("Initial Fetch Size") = 1.   (BTW, I am
using SQLOLEDB as provider).

My problem:
1) I created a VB client to create an instance of manager object in
Form_Load (destroyed in Form_Unload).  The FetchComplete and FetchProgress
events are never raised (I write a line in the log file when each event is
fired).

2) Using the VB client, after Open is called in the staff object, CPU goes
up to 100% for VB6.  No idea why.  (I wonder if this relates to the objects
are free-threaded and vb is apartment threaded.)

3) I put the objects in MTS, created an ASP that has the same content as in
VB, except the object is destroyed in OnSession_End.  Same thing happens as
in VB program.  (Do I need to do anything special in MTS to let it know this
object is free-threaded?)

Any idea?  Thank you in advance.

Anita




Sun, 02 Jun 2002 03:00:00 GMT  
 free threaded ATL, MTS, ADO problem
Your problem is probably due to the fact that MTS components should be
Apartment Threaded, NOT Free Threaded.

You should create your component as if you are creating a component for a
single user. MTS will take care of the rest. MTS will create multiple
instances of your component.

Chris Rolon


Quote:
> Hi all,

> I created two free threaded ATL COM objects (one call manager, another
call
> staff) using VC++ 6 with SP3.  manager creates and instance of staff, the
> staff retrieves an ADO (2.1) recordset using adAsyncFetch |
adAsyncExecute.
> Before Open is called on the recordset pointer, I set CursorLocation =
> adUseClient, then set Properties("Initial Fetch Size") = 1.   (BTW, I am
> using SQLOLEDB as provider).

> My problem:
> 1) I created a VB client to create an instance of manager object in
> Form_Load (destroyed in Form_Unload).  The FetchComplete and FetchProgress
> events are never raised (I write a line in the log file when each event is
> fired).

> 2) Using the VB client, after Open is called in the staff object, CPU goes
> up to 100% for VB6.  No idea why.  (I wonder if this relates to the
objects
> are free-threaded and vb is apartment threaded.)

> 3) I put the objects in MTS, created an ASP that has the same content as
in
> VB, except the object is destroyed in OnSession_End.  Same thing happens
as
> in VB program.  (Do I need to do anything special in MTS to let it know
this
> object is free-threaded?)

> Any idea?  Thank you in advance.

> Anita





Thu, 15 Aug 2002 03:00:00 GMT  
 free threaded ATL, MTS, ADO problem
if you want free threaded ado objects you have to enable that in the
registry...

see
c:\program files\common files\system\ado\adofre15.reg

But I agree with Chris. Why suffer so much pain if MTS handles apartment
threaded objects gracefully?


Quote:
> Your problem is probably due to the fact that MTS components should be
> Apartment Threaded, NOT Free Threaded.

> You should create your component as if you are creating a component for a
> single user. MTS will take care of the rest. MTS will create multiple
> instances of your component.

> Chris Rolon



> > Hi all,

> > I created two free threaded ATL COM objects (one call manager, another
> call
> > staff) using VC++ 6 with SP3.  manager creates and instance of staff,
the
> > staff retrieves an ADO (2.1) recordset using adAsyncFetch |
> adAsyncExecute.
> > Before Open is called on the recordset pointer, I set CursorLocation =
> > adUseClient, then set Properties("Initial Fetch Size") = 1.   (BTW, I am
> > using SQLOLEDB as provider).

> > My problem:
> > 1) I created a VB client to create an instance of manager object in
> > Form_Load (destroyed in Form_Unload).  The FetchComplete and
FetchProgress
> > events are never raised (I write a line in the log file when each event
is
> > fired).

> > 2) Using the VB client, after Open is called in the staff object, CPU
goes
> > up to 100% for VB6.  No idea why.  (I wonder if this relates to the
> objects
> > are free-threaded and vb is apartment threaded.)

> > 3) I put the objects in MTS, created an ASP that has the same content as
> in
> > VB, except the object is destroyed in OnSession_End.  Same thing happens
> as
> > in VB program.  (Do I need to do anything special in MTS to let it know
> this
> > object is free-threaded?)

> > Any idea?  Thank you in advance.

> > Anita





Fri, 16 Aug 2002 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. ADO/MTS/ATL problem

2. Threading Model of MTS-based ATL components

3. problem accesing ORacle Using ADO in MTS

4. Problem with ADO recordsets of recordsets under MTS

5. ATL ,MTS Problem

6. VC ATL Com with MTS support problem!!

7. free threading on ATL

8. ATL COM object with FREE threading

9. Help: Connect to Oracle via MTS using ADO?

10. Passing an external ADO connection into an MTS component

11. Losing ADO Source value in MTS call

12. ADO In ATL Project,ADO Version,CreateInstance Failed

 

 
Powered by phpBB® Forum Software