logo       

Re: session attribute timouts: msg#00471

Subject: Re: session attribute timouts
Christian,

We wrote something we call a "minisession" that does something like what you describe, and it's to address exactly the situation you discuss (as well as tracking data across multi-page forms). Basically we have an attribute in the HttpSession object that's a Map from String (id's) to MiniSessions. MiniSessions are mainly just a Map of attributes, but also some time (created and accessed) information. A background thread can then go through and delete aged minisessions from your session.

With this setup, you can create minisessions when you do the search, storing all the extended options into the minisession attributes. Then you only need to pass the minisession ID around. As the person does extra searching, you can either create new minisessions, or just change the one you are tracking.

Hope this explains the idea well enough, or at least gives you some other ideas.

--
Serge Knystautas
President
Lokitech >> software . strategy . design >> http://www.lokitech.com/
p. 1.301.656.5501
e. sergek@xxxxxxxxxxxx

Christian Andersson wrote:
Hi here, I have a small problem that I have just enountered (trying to solve a different problem)

I have one search page with about 20 to 30 parameters on it... doing a search using this page will result in one or several pages with results for the search.. (pressing next/prev links)

When doing pages like this, I have come upon a limitation of http (I think) in that I must send all the parameters from the "post" of the search page to the "next" pages with the extra parameter of which page to view...

AND there is a second limitation in designing pages like this... If the designer/html-coder forgets to "pass on" a parameter from the search page to the "next" pages.. then the search will behave differently on page 2, etc... (does any help here exist within the servlet/jsp system?)

so I thought, can these parameters be stored somehwere so that I more easily can program the page? without having to check that all parameters are passed on?.. Well I cannot store the parameters in the request.. since when the user presses the "next" link it is a new request.. and page is well even a smaller scope then request, so that leavs me with session...

so I'm planning on storing these parameters in the session, but since an user can have several searches going on at the same time (using the same search page) and there can be many different searchs, each search has to have it's own session variable storing all the different search parameters..

I can then use an url like this...
 result.jsp?para1=1&para2=2para3=3&...
 result.jsp?data=1&page=2
 result.jsp?data=1&page=3
 result.jsp?data=1&page=4

Then the jsp will fetch the parameters from the session-variable (named "data-1").. however THIS will have in the end a BIG drawback...

if an user makes about 1000 searches during 1 session (the session never terminates) there will be 1000 session variables stored...

so my question (in short) is it possible to set an timeout to an session viarable... so that if the variable has not been touched (read/written) for a while (perheps the normal session timeout value (30 minuts) ) it will be removed... is there something in resin I can use for this?

or do I have to create this timeoutfunction myself? (in short creating a subsystem till session that handles this)

or is this a bad idea altogether?

/Christian Andersson





Ruby Jobs
Java Jobs
Jobs in California
more...
what
job title, keywords
where
city, state, zip
jobs by job search
<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

Recently Viewed:
linux.drivers.b...    security.firewa...    mathematics.lps...    web.zope.plone....    x25/2005-12/msg...    culture.tv.sout...    pld.user.polish...    qplus.devel/200...    version-control...    openbsd.bugs/20...    distributions.g...    gnu.chess.bugs/...    redhat.release....    emacs.bugs/2002...    java.bio.genera...    ataraid/2005-01...    finance.moneyda...    hardware.microc...    netbsd.ports.xe...    bug-tracking.gn...    text.xml.saxon....    kde.linux/2002-...   
Home | blog view | USPTO Patent Archive | advertise | OSDir is an inevitable website. super tiny logo