You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by ta...@comcast.net on 2005/04/05 21:29:15 UTC

Hook into when the Visit is de-referenced.

Hi all,

I have a need to know when the Visit is de-referenced from Tapestry's control.
I see in the code where the HttpSession is created and the Visit added. But I'm having trouble locating where it is finally de-referenced from Tapestry.

At some point, it must, or they'd live forever in memory, as there's a reference to it in tapestry, AND in the HttpSession.

I have some resources that need cleaning up after a user is done (database connections, etc, that are being used across request cycles for efficiency).

I have alternate solution that involves keeping an idle time counter on the Visit, and storing a reference to each visit object in my Global object. Each time the user extracts a value from the visit, it resets the idle timer. Another thread would iterate the Visit references in the Global object and clean them up (and de-reference them), if the idle time exceeds the HttpSession timeout on the server, ensuring that the HttpSession object is indeed gone.

Don't really want to go that route, I'd really like to see if there's some class I can override or interface Visit can implement to clean up when the user is done (as far as Tapestry is concerned).

Any ideas ?

Thanks in advance !

tappapp




---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org