472,374 Members | 1,597 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,374 software developers and data experts.

Release COM object on ASP session timeout?

We are using an out-of-process COM object--created with HttpContext.Current.Server.CreateObject("Class.obj ect")--in an VB/ASP.NET 1.x application.

The COM object releases a-ok when we use System.Runtime.InteropServices.Marshal.ReleaseComO bject to release the object. We are running into trouble when our users don't hit the logout button on our web-based application.

Stuffing the ReleaseComObject call from above in Session_End() doesn't seem to do the trick; we get a system.unauthorizedaccessexception permission denied error. I'm guessing this is because the process has already been released in some way because the session has timed out.

We create the com object in a class that we instantiate in our application, so I thought we could use the class destructor. Stuffing the releaseComObject call from above in Protected Overrides Sub Finalize() doesn't work either; this sub doesn't seem to get triggered at all on aspx session timeout.

Finally, I tried a GC.collect in Session_End(), but this didn't seem to do anything either. At least it didn't throw an error.

In all these cases, I look in the task manager and still see the out-of-process com object running after session timeout, and the aspnet_wp.exe is growing on our servers over time, so it seems like some garbage collection is not occuring.

My thoughts were:

1. Is there a way to do all proper garbage collection on session_end?
2. If not, is there a way to create the object at the application, rather than session level (but not in global.asax because they are on-demand during the session), so that I can deal with garbage collection extra-session?

Any thoughts or suggestions would be appreciated. Thanks!

Rich
Apr 26 '07 #1
0 1216

Sign in to post your reply or Sign up for a free account.

Similar topics

10
by: Brian Conway | last post by:
I have no idea what is going on. I have a Login screen where someone types in their login information and this populates a datagrid based off of the login. Works great in debug and test through...
12
by: Geigho | last post by:
Setting session timeout in web.config file does not seem to have any effect. Any explanation or suggestion will be appreciated.
4
by: DavidS | last post by:
First: There are several ways to confuse one regarding session timeout. (1) web.config - <sessionState timeout="20"> (2) IIS Manager | Internet Information Services | ServerNode | Default Web Site...
7
by: Nikhil Patel | last post by:
Hi all, I am using a Session object in my ASP.Net application to store a value of a Database field. I can access it as ... int iProposalId = Session; The session timeout is set to 20. Now my...
2
by: Steve Peterson | last post by:
Hi I have an application that is designed for multi clients, therefore users must go through a login page. Upon logging in I set some properties in a class, one of which is the user id (integer)...
17
by: jensen bredal | last post by:
Hello, i'm struggling with a somehow badly understood session scenario. I provide acces to my pages based on form authentication using Session cookies. Som of my pages are supposed to be...
4
by: UJ | last post by:
I have a page where the user can upload a video file. As you can guess, this may take a while. Is there a way I can change the session timeout for just this one page? I would also want to change...
25
by: =?Utf-8?B?RGF2aWQgVGhpZWxlbg==?= | last post by:
I tried: <sessionState timeout="1"> </sessionState> bounced IIS, and after 1 minute still had a session. ??? -- thanks - dave
5
by: jamie.jamazon | last post by:
I'm currently developing a small MVC framework using classic ASP (don't ask me why!) At it's core it calls the controller script which does the heavy logic and builds disconnected recordsets of the...
2
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and efficiency. While initially associated with cryptocurrencies...
0
by: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge required to effectively administer and manage Oracle...
0
hi
by: WisdomUfot | last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific technical details, Gmail likely implements measures...
0
Oralloy
by: Oralloy | last post by:
Hello Folks, I am trying to hook up a CPU which I designed using SystemC to I/O pins on an FPGA. My problem (spelled failure) is with the synthesis of my design into a bitstream, not the C++...
0
by: Carina712 | last post by:
Setting background colors for Excel documents can help to improve the visual appeal of the document and make it easier to read and understand. Background colors can be used to highlight important...
1
by: Johno34 | last post by:
I have this click event on my form. It speaks to a Datasheet Subform Private Sub Command260_Click() Dim r As DAO.Recordset Set r = Form_frmABCD.Form.RecordsetClone r.MoveFirst Do If...
1
by: ezappsrUS | last post by:
Hi, I wonder if someone knows where I am going wrong below. I have a continuous form and two labels where only one would be visible depending on the checkbox being checked or not. Below is the...
0
by: jack2019x | last post by:
hello, Is there code or static lib for hook swapchain present? I wanna hook dxgi swapchain present for dx11 and dx9.
0
DizelArs
by: DizelArs | last post by:
Hi all) Faced with a problem, element.click() event doesn't work in Safari browser. Tried various tricks like emulating touch event through a function: let clickEvent = new Event('click', {...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.