Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Deleting object also deletes copy stored in session object???

Status
Not open for further replies.

pamam

Programmer
Sep 13, 2001
12
0
0
US
Hi,

The problem is as follows.

<!-- xyz is our own concoction-->
set recRequestByCust = CreateObject(xyz)

<!--save it for future use by another page-->
If IsObject(recRequestByCust) Then
set Session(&quot;RECORDSET&quot;) = recRequestByCust

<!-- I'm done with rec now, and to avoid a memory leak I destroy it -->
recRequestByCust.Close ---------------------1
set recRequestByCust= nothing ---------------2

In another page same session or even in the same page I use

Set newrec = Session(&quot;RECORDSET&quot;)
<!-- but it says that it is closed and cannot use it.
if I comment out lines ----1 and ----2 above it works OK.

Q(1)-- Does the session.contents(key) cause an addref() for the object or not when it is copied into the session variable? I've not been able to find this info anywhere.

Q(2)-- Or is our object xyz not constructed properly? All other aspects of the object workd well.
-->

Thanks in advance.
Mel
 
Actually we used the Server.CreateObject and then the Object is stored in the Session(SES_SRSDOCUMENTOBJ)
like this

set Session(SES_SRSDOCUMENTOBJ) = SERVER.CreateObject(&quot;NECDocLibSRS.NECServiceRequestDocumentSRS&quot;)

then we use this to get the recordset

set recRequestByCust = Session(SES_SRSDOCUMENTOBJ).GenericQuery(&quot;REQUESTBYCUSTOMER&quot;,vtNames,vtValues )

This returns an object of type NECRecordset. That's our own version of COM we knowingly call NECCOM.

In trying to simplify the problem I may have left out some important details, sorry about that. It seems everyone around here is accepting this tipe of behaviour and it is resulting in tons of memory leaks which I have been assigned to clean up.

Mel
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top