Hi all
My company are slowly migrating from vb6/com environment to a .net/web service environment. At the moment we have a financial system running on our intranet that allows user to request and retrieve reports- we have a .Net web service that retrieves these requests and passes them on to a COM dll, which queries the database and generates the reports using Crystal.
After some testing, we've found that when there's more than one person running reports, the system crashes. After some research i've found out that calling a COM component with a .net web service can have threading issues. The COM component works fine when called in serial though
The obvious solution is to rewrite the component in .NET as this would work perfectly with the .NET web service- but time is an issue. It took months to create the exisiting component and we want to continue to utilize it if we can
Does anyone have any suggestions?
Thanks a lot in advance
Neile
chandresh - 10 Feb 2004 00:37 GMT
>-----Original Message-----
>Hi all,
>
>My company are slowly migrating from vb6/com environment to a .net/web service environment. At the moment we have
a financial system running on our intranet that allows
user to request and retrieve reports- we have a .Net web
service that retrieves these requests and passes them on
to a COM dll, which queries the database and generates
the reports using Crystal.
>After some testing, we've found that when there's more than one person running reports, the system crashes.
After some research i've found out that calling a COM
component with a .net web service can have threading
issues. The COM component works fine when called in
serial though.
>The obvious solution is to rewrite the component in .NET as this would work perfectly with the .NET web service-
but time is an issue. It took months to create the
exisiting component and we want to continue to utilize it
if we can.
>Does anyone have any suggestions?
>
[quoted text clipped - 3 lines]
>.
>****************************************
I would suggest you try this first.
Type Library Importer
Use Type Library Importer (TlbImp.exe). TlbImp.exe is a
command-line tool that converts COM type library to
assembly containing metadata.
TypeLibConverter Class
The TypeLibConverter Class of the
System.Runtime.InteropServices namespace provides methods
to convert a type library to an assembly. This API can
convert in-memory Type library and produces output as
TlbImp.exe
Jim - 11 Feb 2004 04:13 GMT
The first thing that comes to mind is to change the apartment model of the
COM component to be a single threaded apartment model rather than free
threaded. I've never used VB to create a COM component though, so I dunno if
this is even possible.
The other thing you could do, is to create a .NET wrapper class around the
COM component that performs the thread synchronization. Then, call the .NET
wrapper in your web application. This has the added bonus of allowing you to
incrementally replace the COM method implementations with .NET
implementations without changing the interface.
Hope this helps!
-Jim
> Hi all,
>
> My company are slowly migrating from vb6/com environment to a .net/web service environment. At the moment we have a financial system running on our
intranet that allows user to request and retrieve reports- we have a .Net
web service that retrieves these requests and passes them on to a COM dll,
which queries the database and generates the reports using Crystal.
> After some testing, we've found that when there's more than one person running reports, the system crashes. After some research i've found out that
calling a COM component with a .net web service can have threading issues.
The COM component works fine when called in serial though.
> The obvious solution is to rewrite the component in .NET as this would work perfectly with the .NET web service- but time is an issue. It took
months to create the exisiting component and we want to continue to utilize
it if we can.
> Does anyone have any suggestions?
>
> Thanks a lot in advance.
>
> Neile
Dilip Krishnan - 11 Feb 2004 14:55 GMT
Jano,
Is the com component global multiuse. You could try that if you have
access to the component. If not you may have to go with a .net wrapper
over the com object
Regards
Dilip
> Hi all,
>
[quoted text clipped - 8 lines]
>
> Neile