NetTalk Central

Author Topic: Garbage collection - calling other procedures  (Read 3078 times)

CaseyR

  • Sr. Member
  • ****
  • Posts: 448
    • View Profile
    • Email
Garbage collection - calling other procedures
« on: August 26, 2014, 05:51:21 PM »
Hi,

I use In Memory files extensively each with the SessionID as both a column and key. These are regularly cleaned up as the user moves from page to page but I would like to delete any in memory records associated with the session if the user logs out or the session times out.

I looked through the WebServer GarbageCollector method and saw it frequently tests for whether a session should be cleaned up and then does it if necessary.   The embed points for the WebServer procedure would fire with each test regardless of garbage collection was done or not.  I can see it is done this way to provide a critical section for the global sessions queue.

Still, is there any way to pass the SessionID of a deleted session from within the method?   Any other way to execute a procedure with the SessionID when the user logs out or abandons a session?



Thanks.

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11244
    • View Profile
Re: Garbage collection - calling other procedures
« Reply #1 on: August 27, 2014, 09:17:49 PM »
Hi Casey,

the correct place to embed this code is in the NotifyDeleteSession method.
At that point the session ID (and only the session ID) are available for you. The session itself is partially, or completely, deleted by this point.

cheers
Bruce

CaseyR

  • Sr. Member
  • ****
  • Posts: 448
    • View Profile
    • Email
Re: Garbage collection - calling other procedures
« Reply #2 on: August 28, 2014, 10:02:50 AM »
Perfect.  Thanks, Bruce.