Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > control the session timeout in web container if database query isstill running

Reply
Thread Tools

control the session timeout in web container if database query isstill running

 
 
Steve
Guest
Posts: n/a
 
      01-06-2009
The web application times out at the end of 30 minutes inactivity.
However, if the
database query runs more than 30 minutes/or hangs, the web application
still times
out at the end of 30 minutes. I think the web container has no idea
the
database query is still running on the database side. My question is
what is the
best approach to control the session timeout in the web container if
the database
is processing the query?

<session-config>
<session-timeout>30</session-timeout>
</session-config>

thanks a lot!
 
Reply With Quote
 
 
 
 
Arved Sandstrom
Guest
Posts: n/a
 
      01-07-2009
On Tue, 06 Jan 2009 12:55:20 -0800, Steve wrote:

> The web application times out at the end of 30 minutes inactivity.
> However, if the
> database query runs more than 30 minutes/or hangs, the web application
> still times
> out at the end of 30 minutes. I think the web container has no idea the
> database query is still running on the database side. My question is
> what is the
> best approach to control the session timeout in the web container if the
> database
> is processing the query?
>
> <session-config>
> <session-timeout>30</session-timeout>
> </session-config>
>
> thanks a lot!


I guess one approach would be to setMaxInactiveInterval() on the session
in question, the one that has the seriously long query. If nothing else,
set it to unlimited. After all, when the session is done you can
invalidate it.

If not doing this, you might want to consider having a MDB initiate the
query, and receive the results. You'll have to have some mechanism in
case the session does timeout, so that when a user/service logs back in,
in search of their data, they can retrieve the information they need to
look up the data.

Just some thoughts.

AHS
 
Reply With Quote
 
 
 
 
Arne Vajh°j
Guest
Posts: n/a
 
      01-12-2009
Steve wrote:
> The web application times out at the end of 30 minutes inactivity.
> However, if the
> database query runs more than 30 minutes/or hangs, the web application
> still times
> out at the end of 30 minutes. I think the web container has no idea
> the
> database query is still running on the database side. My question is
> what is the
> best approach to control the session timeout in the web container if
> the database
> is processing the query?
>
> <session-config>
> <session-timeout>30</session-timeout>
> </session-config>


30 minutes ?

I don't think you should expect your users to wait 30 minutes
in a web app.

Stuff the task in a queue, have an MDB process it and email
the user back when it is done.

Arne
 
Reply With Quote
 
Wojtek
Guest
Posts: n/a
 
      01-12-2009
Steve wrote :
> The web application times out at the end of 30 minutes inactivity.
> However, if the
> database query runs more than 30 minutes/or hangs, the web application
> still times
> out at the end of 30 minutes. I think the web container has no idea
> the
> database query is still running on the database side. My question is
> what is the
> best approach to control the session timeout in the web container if
> the database
> is processing the query?


30 minutes for a query? Yikes!

Kick off a thread to do the database query, then return to the user
with a status page and a message that the query is running. Set the
page refresh to a minute or so. The servlet needs check to see if a
data base query is running for that user, and if so check to see if the
query is finished. If not, increment some sort of counter and
re-display the status page.

--
Wojtek


 
Reply With Quote
 
Arne Vajh°j
Guest
Posts: n/a
 
      01-12-2009
Wojtek wrote:
> Steve wrote :
>> The web application times out at the end of 30 minutes inactivity.
>> However, if the
>> database query runs more than 30 minutes/or hangs, the web application
>> still times
>> out at the end of 30 minutes. I think the web container has no idea
>> the
>> database query is still running on the database side. My question is
>> what is the
>> best approach to control the session timeout in the web container if
>> the database
>> is processing the query?

>
> 30 minutes for a query? Yikes!
>
> Kick off a thread to do the database query, then return to the user with
> a status page and a message that the query is running. Set the page
> refresh to a minute or so. The servlet needs check to see if a data base
> query is running for that user, and if so check to see if the query is
> finished. If not, increment some sort of counter and re-display the
> status page.


If a message queue and a MDB is an option, then it is better than
starting threads in the app code - it is not mandatory in web container
as in EJB container, but I will still consider it best practice to
leave the thread management to the container in a web container.

Arne
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
DataBase DataBase DataBase DataBase scott93727@gmail.com Computer Information 0 09-26-2012 09:40 AM
Session Timeout problems-web.confg session state and IIS session s =?Utf-8?B?Um9iSEs=?= ASP .Net 4 04-11-2007 04:52 PM
Timeout::timeout and Socket timeout Mark Probert Ruby 1 10-06-2004 09:30 AM
Session contents lost despite Session.Timeout = 3000; and <sessionState mode="InProc" cookieless="false" timeout="300"> Carpe Diem ASP .Net 3 02-23-2004 07:10 PM
web.config session timeout and forms authentication timeout Do ASP .Net 2 11-23-2003 02:27 PM



Advertisments