ASP.NET and COM+ produces error: Unable to complete async work

G

Guest

Hi,

We have an ASP.NET application that uses Server.CreateObject in the .aspx
pages to create (ASP) COM-components (we use the 'aspcompat="true"' option).

From the beginning we have seen COM+ errors in the event log and users being
hung or getting Internal Server Errors.

The error is:
The run-time environment has detected an inconsistency in its internal
state. This indicates a potential instability in the process that could be
caused by the custom components running in the COM+ application, the
components they make use of, or other factors. Error in
d:\nt\com\complus\src\comsvcs\threads\stawork.cpp(167), hr = 80010108: Unable
to complete async work.

We have done some testing and as it turns out even just doing executing the
command Server.CreateObject('ADODB.Stream') and not doing anything with it,
causes this error if the page is called often enough (1 every 150.000
requests). So there must be something basic wrong here.

Does anybody else have seen this problem? Or does anybody have a clue as to
solve this?

Best regards,

Niels
 
B

bruce barker \(sqlwork.com\)

you probably not releasing the com objects explicity. asp.net sites should
do this rather than counting on the GC to do it for you. every time you use
a com object, when done, you should call Marshal.ReleasecomObject. ths also
means you should never use more than 1 dot when acessing a com object or you
can not release the temp object reference.

-- bruce (sqlwork.com)
 
G

Guest

Hi Bruce,

Thanks for the tip. I'm running a test right now. I'm still seeing memory
going up, but that might be a leak in the COM component it self or is it not
possible to use the following construct?

<%@language="JScript" aspcompat="true"%>
<%
var oObject = Server.CreateObject("My.ComObject");
try
{
%>
<html>
do my stuff with oObject within .aspx page
</html>
<%
}
finally
{
System.Runtime.InteropServices.Marshal.ReleaseComObject(oObject);
}
%>

By the way, I did not understand what you meant with "[...] you should never
use more than 1 dot when acessing a com object [...]". Can you explain this?

Thanks,

Niels
 

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

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,819
Latest member
masterdaster

Latest Threads

Top