Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / Component Services / October 2003

Tip: Looking for answers? Try searching our database.

Remoting and COM+

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Manuel Lopez - 22 Oct 2003 13:15 GMT
Hello,

Sorry for this post in this group, but maybe somebody has had the same
problem.

I have a simple VB6 dll registered in COM+, with a hello world public
funtion.

It is a server application, and the class has the no transactions
property set.

When I instanciate this class from asp 3.0 applications through COM+
proxys , the objects in COM+ get created and destroyed and everything
works correctly.

Now we need to use this component through ASP.net and remoting.

We interoperate with COM+ using TLBIMP and generate a Remote callable
wrapper, we place this warapper in a virtual directory in IIS, and
configure a web.config to access via remoting.

On the client side we have antother web.config that calls the IIS
hosted component from ASP.Net.

Our problem is that on every call made from the ASP.net web from a new
object is created and activated in the COM+ console. Growing up to
5000 or more objects, having to reboot the server machine.

We have tried both CAO and singlecall SAO, and the behaviour is the
same for both cases.

Maybe our activation scheme is not correct, but we have use these COM+
components to access our datastore. (they don´t do any complex stuff
they just access our legacy database)

We thought that interoperating with COM+ would be really easy with the
tools that the framework provides, we also thought that IIS Remoting
would give us the container functionality of COM+.

But our problem is that for a simple hello world VB6 DLL in COM+,
accessed through tlbimped wrappers and  IIS remoting:  the objects in
COM+ never stop growing and never get destroyed.

We are really stuck on this, and any help would be really appreciated.

Thanks In Advance,

Manuel
Slava Gurevich - 22 Oct 2003 17:10 GMT
Assuming the COM+ setting is not using JIT with
autocomplete/SetComplete, do you call Marshal.ReleaseCOMObject(obj) in
your client code to properly release the object reference?

Slava Gurevich

>Hello,
>
[quoted text clipped - 44 lines]
>
>Manuel
Manuel Lopez - 23 Oct 2003 09:11 GMT
Hello Slava,

Thanks for your reply.

I cannot call Marshall.ReleaseComObject remotely.

My ASP.net calls an IIS hosted Net dll which is a tlbimped wrapper of
a very simple vb6 com+ dll. (One hello World Method) This is invoked
via remoting as SAO singlecall.

ASP.Net->IIS Remoting->Tlbimped Wrapper->COM+

Every time i call this remote method, a new object gets created and
activated, and it´s never released.

I really can´t understand it, our scenario i htink is very common ,
where he have lots of com+ components that we still want to use with
net.

Before we had DCOM and it worked fine, but it seems that
interoperating remotely with COM+ doesn´t work as good as it should.

> Assuming the COM+ setting is not using JIT with
> autocomplete/SetComplete, do you call Marshal.ReleaseCOMObject(obj) in
[quoted text clipped - 50 lines]
> >
> >Manuel
Girish Bharadwaj - 23 Oct 2003 13:52 GMT
Umm.. why cant you call Marshall.ReleaseComObject()? You would have
gotten the object for that method through a CCW.. no? I am probably just
confused.

> Hello Slava,
>
[quoted text clipped - 23 lines]
>>
>>Slava Gurevich

Signature

Girish Bharadwaj

Manuel Lopez - 24 Oct 2003 11:43 GMT
Hello Girish,

Many thanks for bothering for all us who are lost.

I get a remoting exception, telling me that you can´t call a static
method remotely.

Here is what we are doing:

server:
- Hello World VB6 DLL (No transactions, Global Multiuse)
- Register in COM+ as Server Application
- TLBIMP over this DLL, generating a RCW
- Place this in a IIS Virtual Dir with web.config configured for
remoting (SAO singlecall)
client:
- copy the tlbimped dll to asp.net project
- configure remoting on application start with web.config
- call method from asp

The invocation works correctly, i see the transparent proxy created
calling the dll remotely on the server, which in turns calls the com+
dll.

On every call i get one object and one activation, and the object
count never stops growing.

I have tried the releasecomobject but it doesn´t work, i guess that
this should be done on the server (where we have the RCW which is
interoperating with COM+).

But as you can see we have to rely on TLBIMP and we just configure
remoting files, on our real scenario we have hundreds of COM+
components who access different legacy systems. We know work with
proxys from client-server apps and from ASP 3.0.In our migration to
.NET we have to interoperate with these COM+ components.

I really don´t know what to do? It is impossible to maintain this
object count.

> Umm.. why cant you call Marshall.ReleaseComObject()? You would have
> gotten the object for that method through a CCW.. no? I am probably just
[quoted text clipped - 27 lines]
> >>
> >>Slava Gurevich
Girish Bharadwaj - 24 Oct 2003 14:15 GMT
> Hello Girish,
>
[quoted text clipped - 35 lines]
> I really don´t know what to do? It is impossible to maintain this
> object count.

<snip/>

Few things to try if feasible:
1. Try setting the "AutoComplete" property on the COM+ component. So
that when the method returns, it will signal the COM+ services to mark
that object for "de-activation".
2. Is there any object pooling active?
3. If you can, try wrapping that object within a ASP.NET page which
basically accepts POST/GET requests and services them by creating an
instance of the RCW and responding. Does this show the same behavior?
4. Write a generic ASP.NET page which instanciates any given object and
calls Marshal.ReleaseCOMObject() on that object once a request is
serviced. (Might be tough to achieve if you have to send back the
reference to the RCW).
Let me know if any of it helps from above..

Signature

Girish Bharadwaj

Slava Gurevich - 24 Oct 2003 16:21 GMT
>> Hello Girish,
>>
[quoted text clipped - 22 lines]
>> On every call i get one object and one activation, and the object
>> count never stops growing.

>Few things to try if feasible:
>1. Try setting the "AutoComplete" property on the COM+ component. So
[quoted text clipped - 9 lines]
>reference to the RCW).
>Let me know if any of it helps from above..

Just a few side comments: setting "autocomplete" in COM+ ( per method)
would require JIT to be enabled in order to work.  Even then the stub
count ("objects" column in COM+ statistics) would continue to grow
until released.  This object cannot be pooled in COM+ since it's
written in VB ( STA +TLS )

I think this would work better if the COM+ proxy was exported and
installed on the client side, where it would be wrapped by the RCW.
This way the Marshal.ReleaseCOMObject could be used;  I assume right
now it doesn't work because it has to call all the way through to the
server and it's a static method ( correct me if I am wrong).  

Slava Gurevich
Manuel Lopez - 27 Oct 2003 12:32 GMT
Slava Gurevich <vyach@hotmail.com> wrote in message

> Just a few side comments: setting "autocomplete" in COM+ ( per method)
> would require JIT to be enabled in order to work.  Even then the stub
[quoted text clipped - 9 lines]
>
> Slava Gurevich

Hello Slava,

You are correct, if we install the COM+ proxys in the client side, and
then wrapp with TLBIMP, Marshall.ReleaseCOMObject works since there is
no remoting involved (it´s all in the client, and the comunication is
via DCOM).

But this is exactly what we don´t want to do, Remoting is much more
easier to configure than DCOM.

I think that in our case we are missing some configuration or setting.
It is a very simple approach:
SERVER
- VB6 DLL (one hello world method) in COM+
- TLBIMP over this DLL, place it in IIS with a server web.config for
remoting (SAO singlecall)
CLIENT
- Copy this dll in client machine, reference it from ASP.net page
- configure client web.config for remoting and load it on
application_start

As you can see it is very easy, and we think it is a good way to reuse
all our legacy com+ with net (this is what Interoperability is all
about).

But this simple example makes the object count grow, and it never
stops.

There must be something that we are missing.

Many thanks,

We really appreciate your help.

Manuel
Wray Smallwood - 29 Oct 2003 18:54 GMT
I would suggest buying the book Programming .NET Components by Juval Lowy.
You will find a lot of insight into your problem. The basic issue will come
down to the marriage of the .NET world with the COM+ world and how objects
are created and destroyed. Even the first chapter has a lot of information
to digest.

Wray Smallwood

> Slava Gurevich <vyach@hotmail.com> wrote in message
>
[quoted text clipped - 47 lines]
>
> Manuel
Manuel Lopez - 27 Oct 2003 12:15 GMT
Hello Girish,

Thanks again, below my comments.

> Few things to try if feasible:
> 1. Try setting the "AutoComplete" property on the COM+ component. So
> that when the method returns, it will signal the COM+ services to mark
> that object for "de-activation".

I am not using my own serviced components, I just use a RCW over COM+
and place it in IIS.

Is there any option in COM+ console to set Autocomplete?

> 2. Is there any object pooling active?

We don´t have any object pooling, on the COM+ component.

> 3. If you can, try wrapping that object within a ASP.NET page which
> basically accepts POST/GET requests and services them by creating an
> instance of the RCW and responding. Does this show the same behavior?

I think this is what we are doing right know, our ASP.net page creates
an instance of the RCW and calls the method. (singlecall remoting to
IIS)

> 4. Write a generic ASP.NET page which instanciates any given object and
> calls Marshal.ReleaseCOMObject() on that object once a request is
> serviced. (Might be tough to achieve if you have to send back the
> reference to the RCW).
> Let me know if any of it helps from above..

Thanks,

Manuel

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.