This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes Servlets and the fly likes Ignoring a certain transaction so the session is not always alive Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Servlets
Bookmark "Ignoring a certain transaction so the session is not always alive" Watch "Ignoring a certain transaction so the session is not always alive" New topic
Author

Ignoring a certain transaction so the session is not always alive

Carmi Gazit
Greenhorn

Joined: Aug 27, 2003
Posts: 10
I have this situation:
I have a transaction polling that is done every 5 minutes to check on a state in the DB and then if something changes update some UI widget on the Client.
Meanwhile, I also have a 1 hour session timeout limit.
Now that we have this polling the client never times out because the polling is keeping the session alive . So, how do I tell the servlet to 'ignore' this particular transaction and only keep the session alive based on the other , user initiated , transactions?
Can I associate a new session with this particular transaction, to keep it separate from the user initiated transactions? I'm using https .
thanks for any pointers.
Carmi
Jeanne Boyarsky
author & internet detective
Marshal

Joined: May 26, 2003
Posts: 32481
    
214

You could keep your own "last accessed time" in the session for a transaction you care about. Then when a transaction comes in, you see if that last access time is too long and call session.invalidate() yourself.


[OCA 8 book] [Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Other Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, TOGAF part 1 and part 2
Carmi Gazit
Greenhorn

Joined: Aug 27, 2003
Posts: 10
Thanks Jeanne, I think this will give me the solution I need.
 
Have you checked out Aspose?
 
subject: Ignoring a certain transaction so the session is not always alive
 
It's not a secret anymore!