Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsGeneralPHPASPPerlColdFusionFlashHTML, CSS, ScriptsBrowsers

Webmaster Forum / ASP / Components / July 2008



Tip: Looking for answers? Try searching our database.

COM+ app does not shut down when idle if created from an ASP page

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Stephen F - 03 Mar 2008 13:29 GMT
Our web application is layered broadly as follows:

- Classic ASP pages: accept HTTP requests, forward them on to the Web App
COM+ components and output the response.
- Web App COM+ components: processes requests forwarded onto them by ASP
pages, invoke the relevant business rule and data access methods, generate
responses using XSLT and return them to the ASP pages for output.
-Business Rule and Data Access COM+ components: implement the business rule
and data access methods.

The Web App, Business Rules and Data Access COM+ components are grouped
together into separate COM+ applications (a.k.a. packages). Each application
is configured to shut down after 3 minutes of being idle (using the server
process shut down option in Component Services).

The problem we are experiencing is that the Web App COM+ application is
never shutting down (the business rule and data access applications are).
Bizarrely, however, the problem goes away once the Web App COM+ application
has been shut down manually using Component Services—and returns when the
server is next rebooted. Windows 2000, 2003 and XP all seem to be affected.

Obviously there could be any number of causes; however, I have managed to
reproduce this behaviour with a few very simple test cases.

Test 1
------

1.    Create a new COM+ server application named TestApp1. Use default values
for all settings except idle shutdown time which should be set to 1 minute
2.    Create a new ActiveX DLL named Test1.dll containing a single, empty,
multiuse class named CTest1
3.    Compile Test1.dll and add it to the TestApp1 COM+ application
4.    Create a new virtual directory
5.    Create a new ASP page named test1.asp in the new virtual directory. This
page should contain the following code:

<%@ Language=VBScript %>
<%
Dim obj
Set obj = Server.CreateObject("Test1.CTest1")
Set obj = Nothing
%>

6.    Reboot the server
7.    Browse to Running Processes in Component Services
8.    Load test1.asp > TestApp1 will start up
9.    Wait two minutes > TestApp1 will still be running (it shouldn’t)
10.    Manually shut down TestApp1
11.    Load test1.asp > TestApp1 will start up
12.    Wait just over one minute > TestApp1 will shut down

Conclusions

- The problem has nothing to do with the code in our COM+ components
- The problem only manifests itself from the moment the server is booted up
until the first time the affected COM+ application is shut down

Test 2:

1.    Create a new COM+ application named TestApp2. Again, use default values
for all settings except idle shutdown time which should be set to 1 minute
2.    Create a new ActiveX DLL named Test2.dll containing a single multiuse
class named CTest2 with the following public method:

Public Sub Test()
Dim objTest1 As CTest1
Set objTest1 = CreateObject("Test1.CTest1")
Set objTest1 = Nothing
End Sub

3.    Compile Test2.dll and add it to the TestApp2 COM+ application
4.    Create a new ASP page named test2.asp in the virtual directory created
for test 1. This page should contain the following code:

<%@ Language=VBScript %>
<%
Dim obj
Set obj = Server.CreateObject("Test2.CTest2")
Call obj.Test
Set obj = Nothing
%>

5.    Reboot the server
6.    Browse to Running Processes in Component Services
7.    Load test2.asp > TestApp1 and TestApp2 will start up
8.    Wait just over one minute > TestApp1 will shut down, TestApp2 will not
(it should)
9.    Manually shut down the TestApp2
10.    Load test2.asp > TestApp1 and TestApp2 will start up
11.    Wait just over one minute > TestApp1 and TestApp2 will shut down

Conclusions:

- COM+ applications whose components are created by other components are
unaffected.

Test 3:

  1. Create a standard executable containing only the following code:

Sub Main()
Dim obj As CTest2
Set obj = CreateObject("Test2.CTest2")
obj.Test
Set obj = Nothing
End Sub

  2. Reboot the server
  3. Browse to Running Processes in Component Services
  4. Run the executable > TestApp1 and TestApp2 will start up
  5. Wait just over one minute > TestApp1 and TestApp2 will shut down

Conclusions:

- This issue does not affect applications whose components are created by
standard executables.

Putting this all together it seems that:

- Only applications whose components are created directly by ASP pages are
affected (so perhaps more of an IIS or ASP issue than a COM+ issue)
- The problem only manifests itself when the server is first booted up
- The problem exists in Windows 2000 and 2003.
Has anyone else been experiencing the same issues? And if so, does anyone
have a solution?
Stephen F - 03 Mar 2008 13:44 GMT
I should also add that we have found a workaround for Windows 2003 server
which is to use COM+ application recycling with the following parameters:

For testing:
- Idle shutdown time: 1 minute
- Lifetime limit: 1 minute
- Expiration time: 1 minute
(The COM+ application will shut down after a maximum of 2 minutes from the
moment it is started)

For production
- Idle shutdown time: 3 minutes (default)
- Lifetime limit: 120 minutes
- Expiration time: 720 minutes

Unfortunately, Windows 2000 (which is used by a significant proportion of
our clients) does not support application recycling, so we're still no closer
to a solution for those systems.
Madan - 21 Jul 2008 13:06 GMT
Hi,

I am too getting the same problem. The COM+ components are not cleared
either from classic ASP or even when using it as an interop from .Net
applications.

But your post gave me some insight, how it could be a problem in the
ASP/COM/MTS implemenetation from Microsfot.

Can any one please help on this.

Ragards,
Madan

> I should also add that we have found a workaround for Windows 2003 server
> which is to use COM+ application recycling with the following parameters:
[quoted text clipped - 14 lines]
> our clients) does not support application recycling, so we're still no closer
> to a solution for those systems.
 
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.