ASPCompact for Com Object.

A

archana

Hi all,

I want to use com component in asp.net. ASp.net runs request on MTA
thread. I read on msdn to use aspcomponet attribute while using com
component.

I also read that 'STA object calls require an STA thread. If you do
not use the ASPCOMPAT attribute, all STA object calls are serialized
on the host STA thread and a serious bottleneck occurs.'

Can anyone tell me what exact bottleneck will occur f i use com
component without setting aspcompact.

please correct me if i am wrong.

thanks in advance.
 
G

Guest

Archana,
First of all the attribute is "ASPCOMPAT" and looks like:

ASPCompat="True"

in the @Page directive.

The description you gave in your post of why you need this attribute if
running ActiveX components in an ASP.NET page is accurate. Serialization
means that all calls to the page would have to wait until the call ahead of
them has completed.
This *IS* the bottleneck.
-- Peter
Recursion: see Recursion
site: http://www.eggheadcafe.com
unBlog: http://petesbloggerama.blogspot.com
BlogMetaFinder: http://www.blogmetafinder.com
 
B

bruce barker

there are three types of com objects, single thread apartment model
(sta), and multithread apartment model (mta) and free threaded.

sta com objects require a single thread. all com objects built with v6
are sta. if built with c++, it depends, see docs.

the aspcompat attribute forces asp.net page proceesing into sta mode.
this means all calls to com objects are done with same thread. it also
turns off thread agility (the same thread is used throughout the page
process).

this causes a bottleneck with concurrent requests, as two requects can
not access the com object at the same time. depending on how fast the
com methods are this can be problem.

if you do not set aspcompat when using sta com objects, two concurrent
requests can cause data corruption in the com object because it can not
support methods being called from teo thread at the same time.

in general com should be avoided in asp.net.

note: asp.net webservices do not support aspcompat, so if you need to
use an sta com object, you will need to create and manage the sta thread
yourself. you can google for sample code.

-- bruce (sqlwork.com)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,770
Messages
2,569,584
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top