PC Review


Reply
Thread Tools Rate Thread

ASPCompact for Com Object.

 
 
archana
Guest
Posts: n/a
 
      15th Oct 2007
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.

 
Reply With Quote
 
 
 
 
=?Utf-8?B?UGV0ZXIgQnJvbWJlcmcgW0MjIE1WUF0=?=
Guest
Posts: n/a
 
      15th Oct 2007
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



"archana" wrote:

> 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.
>
>

 
Reply With Quote
 
bruce barker
Guest
Posts: n/a
 
      15th Oct 2007
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)

archana wrote:
> 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.
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Deserialization - Can see object properties in Visual Studiointellisense but receive object refernce not set error. YZ Microsoft C# .NET 0 27th Jun 2011 09:19 AM
copy object or export object, can't open object laavista Microsoft Access 5 28th Jun 2009 04:50 AM
Unable to cast COM object of type 'ADODB.RecordsetClass' to classtype 'System.Object[]' matthieu.sarthou@googlemail.com Microsoft VB .NET 20 22nd Feb 2008 04:08 PM
Programmatically detach object in unbound object frame to a bound object frame Haiyan Chen Microsoft Access Form Coding 0 4th Mar 2005 02:51 PM
Programmatically detach object in unbound object frame to a bound object frame Haiyan Chen Microsoft Access Form Coding 0 4th Mar 2005 02:47 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:42 PM.