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!

How do you remove a SharedProperty value?

Status
Not open for further replies.

cradster

Programmer
Sep 9, 2000
7
0
0
GB
I have a VB6 AcitveX DLL that uses MTS SharedPropertyManager. My object is called from ASP pages and the SessionID of the callers session is used as a Property name when creating a SharedProperty. When the users session dies (Session_OnEnd()) I would like to be able to destroy or delete the property that I created specific to the current users session. The only methods within the SharedProperty objects are to reference an existing property or to create a new one. How would I implement a DeleteProperty method of my own, bearing in mind that a new property gets created everytime a user hits my website.
 
The closest I seen to doing this is to set the value to a Null. Yes, the property is still there (and will remain there until the process comes down), but the memory consumotion is minimal. If there is a way to actually REMOVE the property without bringing the process down, I would love to know it as well. Util then, just set it to null and go on. - Jeff Marler B-)
 
As far as i know, there's no way to remove a shared property, to solve this, I "reuse" the memory or set it to null when it's not used. May be you should try some way to mark the shp as deleted and then reuse instead of create a new one.

DASMAN
 
DASMAN,
Your idea would work great (reusing the Shared Property) unless the index used to retrieve that property meant something (such as state/product codes). If the index key use is not important, then most definitely reuse the "expired" properties. Otherwise, the best I can think of is top set them to Null.
Does anyone out there actually know how to physically remove a shared property without bringing the process down?
- Jeff Marler B-)
 
I have managed to work around this problem by reusing expired properties, to do this I keep some XML (Stored As A Shared Property)which I use as a cross reference data source, instead of using the SessionID of the callers ASP session as the Name of the property, I use PropertyByPosition. The SessionID then maps to the Position (PropertyByPosition) that is relevent to the Caller. When a Session Expires (SessionOnEnd()) I set the PropertyByPosition to Null and flag the position as being available. I know this isn't a fix, just a workaround, I would prefer to be able to destroy expired properties, but for now, this solution works 4 me.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top