Hi Friends,

Now I'm using the COM+ and classic asp for my project. The COM+ code project file is the kind of template file that has been used for more than 10 years before i joined to my company. And then I also use the same code to make new COM+ dll files.

Now we are having the memory leak in our server and when I found out the Handles of the COMs are extremely high and the number of bytes allocated by semaphore are increasing till the server goes crush. So, what kind of code that I need to put in the COM to ensure that all the handles for that COMs are closed/released.

Thanks in advance.
Win.

Here are the sample of my COM+ code:
==============================

Public Function Report1() As Variant
On Error GoTo err_handler
Dim mOraDatabase As OraDatabase
Dim mOraSession As OraSession
Dim mOraDynaset As OraDynaset
Dim objctx As ObjectContext
Dim ar(4) As Variant

Set mOraSession = CreateObject("OracleInProcServer.XOraSession")
Set mOraDatabase = mOraSession.OpenDatabase(DBSRV, USRPASS, 0&)
Set objctx = GetObjectContext

'Remove
mOraDatabase.Parameters.Remove "stroutdata1"
mOraDatabase.Parameters.Remove "stroutdata2"
mOraDatabase.Parameters.Remove "stroutdata3"
mOraDatabase.Parameters.Remove "status"

mOraDatabase.Parameters.Add "stroutdata1", Space(30000), ORAPARM_OUTPUT
mOraDatabase.Parameters("stroutdata1").serverType = ORATYPE_VARCHAR2

mOraDatabase.Parameters.Add "stroutdata2", Space(30000), ORAPARM_OUTPUT
mOraDatabase.Parameters("stroutdata2").serverType = ORATYPE_VARCHAR2

mOraDatabase.Parameters.Add "stroutdata3", Space(30000), ORAPARM_OUTPUT
mOraDatabase.Parameters("stroutdata3").serverType = ORATYPE_VARCHAR2

mOraDatabase.Parameters.Add "status", 0, ORAPARM_OUTPUT
mOraDatabase.Parameters("status").serverType = ORATYPE_NUMBER

mOraDatabase.ExecuteSQL ("begin Report1(:stroutdata1,:stroutdata2,:stroutdata3,:st atus); end;")
ar(0) = mOraDatabase.Parameters("status").Value
ar(1) = mOraDatabase.Parameters("stroutdata1").Value
ar(2) = mOraDatabase.Parameters("stroutdata2").Value
ar(3) = mOraDatabase.Parameters("stroutdata3").Value

Report1= ar

'Remove
mOraDatabase.Parameters.Remove "stroutdata1"
mOraDatabase.Parameters.Remove "stroutdata2"
mOraDatabase.Parameters.Remove "stroutdata3"
mOraDatabase.Parameters.Remove "status"

If Not objctx Is Nothing Then
objctx.SetComplete
End If

Set mOraDynaset = Nothing
Set mOraDatabase = Nothing
Set mOraSession = Nothing
Exit Function
err_handler:
If Not objctx Is Nothing Then
objctx.SetAbort
End If
Set objctx = Nothing
Set mOraDatabase = Nothing
Set mOraSession = Nothing
ar(0) = 0
Report1 = ar
End Function