RE: App.Path in Class_Initialize (or VB Runtime threading bug?)

From: DJThompson (DJThompson_at_discussions.microsoft.com)
Date: 12/17/04


Date: Fri, 17 Dec 2004 06:43:02 -0800

We're having the same symptoms. For us, it appears to be a threading problem
with VB runtime. We have an ASP application calling a method in a component
registered in COM+ Services. Our code works fine (famous last words) but
when we call Replace() or Dir() in the VB Runtime (MSVBVM60.DLL) we get
"ActiveX component cannot create object". Our ASP pages work fine until the
site is under heavy load. We presume that as IIS starts using more and more
threads for serving requests, we end up calling the Replace() and Dir()
functions from multiple threads simultaneously. When this happens, some ASP
page requests will fail with the aforementioned error.

We originally noticed the behaviour when continously pressing F5 very
quickly - some requests would fail.

**We can reliably reproduce the error in the VB runtime** simply with a
small multi-threaded C# application (source available: post here to request)
which calls a method in a VB6 COM+ DLL multiple times simulaneously across
multiple threads. The VB6 DLL method just calls the Replace() function. As
a result, we get "ActiveX component cannot create object" errors arising from
making the Replace() call. This error is not arising as a result of
evaluating the parameters to the call.

Our VB6 DLL is configured to use apartment threading - it appears that the
Replace() and Dir() functions no longer work in this model as the result of a
recent change by Microsoft.

Does anyone know of a work-around until Microsoft notices & patches?

Thanks!

"Jason R. Schmidt" wrote:

> Hi, I am having a strange issue with a class in VB6. I am running a
> webserver using IIS on windows 2000 and an ASP UI. I am receiving random
> "activex can't create component" errors. If you refresh the page, the error
> goes away. If you refresh again, it will happen. This occurs randomly. If
> IIS is restarted, the web page doesn't encounter this error until around a
> week later.
>
> The class causing the problem built some logging path information in the
> Class_Initialize method by using the App.Path object. I determined this
> object was causing the problem because the error hasn't happened since we
> removed it.
>
> Just wondering if anyone had ever seen this?
>
> Thanks
>



Relevant Pages

  • RE: App.Path in Class_Initialize (or MS VB runtime threading bug)
    ... We have an ASP application calling a method in a component ... threads for serving requests, we end up calling the Replaceand Dir ... The VB6 DLL method just calls the Replacefunction. ...
    (microsoft.public.vb.bugs)
  • Re: w3wp.exe takes 100% processor
    ... Be careful when using a stress test. ... A typical web user will request 1 asp page every 60 seconds. ... configure the stress tool to delay 60 seconds between requests. ... The CPU utilisation of w3wp rises when users are ...
    (microsoft.public.inetserver.iis)
  • Re: Long-running ASP page using ServerXMLHTTP...
    ... If you are using Sessions it's normal that all requests for a single session ... Updating the cache itself can be done from your ASP page itself, ... > are allowed to execute while we are waiting for the response from the 3rd ...
    (microsoft.public.inetserver.asp.db)
  • Re: Confused about ASP, "sessions", and queuing of multiple requests
    ... cookies (include ASP session state cookie) with the first IE instance. ... and generating multiple HTTP requests from a single IE ... :> running IIS on a multiprocessor server. ...
    (microsoft.public.inetserver.asp.general)
  • Re: Confused about ASP, "sessions", and queuing of multiple requests
    ... cookies (include ASP session state cookie) with the first IE instance. ... and generating multiple HTTP requests from a single IE ... :> running IIS on a multiprocessor server. ...
    (microsoft.public.inetserver.iis)