Re: definition/usage of session-timeout?

2003-11-25 Thread Ben Souther
JSP/Servlet technology uses a solution called the HttpSession to overcome the 
limitations of the stateless HTTP protocol.

Tomcat uses cookies to map a particular web user to his/her session object.
The developer can bind objects to a user's session object and then retrieve 
them on subsequent hits from that user's browser.  The session-timeout 
attribute allows you to explicitly set the length of your webapps sessions. 
The default is 30 mins.

You're trying cancel a particular request.  I don't think that can be done in 
tomcat (someone will correct me if I'm wrong). Even if it could, it would be 
better to get to the root of the problem and fix that.

Try putting a bunch of System.out.println(  ) statements in your code, 
tail the catalina log, and hit your app to find out which line of code is 
causing it to hang.

The catalina.log file is in TOMCAT_HOME/logs.  All standard out and standard 
error messages get routed to there by default.

The Unix tail command with the -f option will allow you to watch the logfile 
as it is being written to, in real time.

-Ben














On Monday 24 November 2003 07:00 pm, you wrote:
 Hi,
 I'm a relatively new Tomcat user, running 4.0.4 (testing on Windows,
 deploying on Sun UNIX).  The UNIX servlet is having rare problems
 hanging, for which the exact cause is unknown.

 I'm trying to see if a session timeout can solve the problem, but have not
 been able to get it to work.  Numerous archives talk about this, and it
 seems like I'm doing what everyone suggests, but it's not working.

 In my web.xml file, I have the following, as a test of one-minute timeout:

   session-config
   session-timeout1/session-timeout
/session-config

 I have made a call the HttpSession.getMaxInactiveInterval, and it returns
 60 (seconds, I presume), so I believe the parameter is being applied.  I
 have tried 2 different approaches to simulate an inactive server:

 1)  Manually update a database row (but don't commit) before the servlet
 call, then have the servlet try to update the same row 2)  Use
 Thread.sleep(12)

 In both cases, the 1 minute timeout doesn't do anything.  So what
 constitutes an inactive session, for which this parameter was designed? 
 If it likely won't solve my problem, does anyone have an idea on how I can
 kill the request after a given amount of time?


 much thanks,

 -Ron

 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: definition/usage of session-timeout?

2003-11-25 Thread Ron W.
Ben, 
   Thanks for the reply.  But I'm still unclear on why setting the timeout won't work 
for my situation.  What is the difference between an effectively idle session timing 
out, and cancelling a request?

Of course I agree that fixing the root problem would be preferable, but it's extremely 
hard to diagnose.  Putting in println's everywhere would in my case generate huge log 
file sizes, and I'll only try that as a last resort.

Can anyone suggest a different technique for simulating an inactive session, so that 
I can get session-timeout to work?


thanks,

-Ron

--
Ben Souther wrote:

JSP/Servlet technology uses a solution called the HttpSession to overcome the 
limitations of the stateless HTTP protocol.

Tomcat uses cookies to map a particular web user to his/her session object.
The developer can bind objects to a user's session object and then retrieve 
them on subsequent hits from that user's browser.  The session-timeout 
attribute allows you to explicitly set the length of your webapps sessions. 
The default is 30 mins.

You're trying cancel a particular request.  I don't think that can be done in 
tomcat (someone will correct me if I'm wrong). Even if it could, it would be 
better to get to the root of the problem and fix that.

Try putting a bunch of System.out.println(  ) statements in your code, 
tail the catalina log, and hit your app to find out which line of code is 
causing it to hang.

The catalina.log file is in TOMCAT_HOME/logs.  All standard out and standard 
error messages get routed to there by default.

The Unix tail command with the -f option will allow you to watch the logfile 
as it is being written to, in real time.

-Ben


Original message:

Hi,
I'm a relatively new Tomcat user, running 4.0.4 (testing on Windows, deploying on 
Sun UNIX).  The UNIX servlet is having rare problems hanging, for which the exact 
cause is unknown.

I'm trying to see if a session timeout can solve the problem, but have not been able 
to get it to work.  Numerous archives talk about this, and it seems like I'm doing 
what everyone suggests, but it's not working.

In my web.xml file, I have the following, as a test of one-minute timeout:

  session-config
  session-timeout1/session-timeout
   /session-config

I have made a call the HttpSession.getMaxInactiveInterval, and it returns 60 (seconds, 
I presume), so I believe the parameter is being applied.  I have tried 2 different 
approaches to simulate an inactive server:

1)  Manually update a database row (but don't commit) before the servlet call, then 
have the servlet try to update the same row
2)  Use Thread.sleep(12)

In both cases, the 1 minute timeout doesn't do anything.  So what constitutes an 
inactive session, for which this parameter was designed?  If it likely won't solve 
my problem, does anyone have an idea on how I can kill the request after a given 
amount of time?


much thanks,

-Ron


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: definition/usage of session-timeout?

2003-11-25 Thread Ben Souther
A session timeout just means that the next time you hit the site with the same 
browser, you will be assigned a new JSPSessionID to bind that transaction 
with your session object.  It would do nothing to stop a request that's hung.

Think of a request as one hit to a server and a session as several hits 
over a given period of time.

What you're looking for is a script timeout which, to the best of my 
knowlege, doesn't exist in the servlet spec.



On Tuesday 25 November 2003 10:08 am, Ron W. wrote:
 Ben,
Thanks for the reply.  But I'm still unclear on why setting the timeout
 won't work for my situation.  What is the difference between an effectively
 idle session timing out, and cancelling a request?

 Of course I agree that fixing the root problem would be preferable, but
 it's extremely hard to diagnose.  Putting in println's everywhere would in
 my case generate huge log file sizes, and I'll only try that as a last
 resort.

 Can anyone suggest a different technique for simulating an inactive
 session, so that I can get session-timeout to work?


 thanks,

 -Ron

 --
 Ben Souther wrote:

 JSP/Servlet technology uses a solution called the HttpSession to overcome
 the limitations of the stateless HTTP protocol.

 Tomcat uses cookies to map a particular web user to his/her session object.
 The developer can bind objects to a user's session object and then retrieve
 them on subsequent hits from that user's browser.  The session-timeout
 attribute allows you to explicitly set the length of your webapps sessions.
 The default is 30 mins.

 You're trying cancel a particular request.  I don't think that can be done
 in tomcat (someone will correct me if I'm wrong). Even if it could, it
 would be better to get to the root of the problem and fix that.

 Try putting a bunch of System.out.println(  ) statements in your
 code, tail the catalina log, and hit your app to find out which line of
 code is causing it to hang.

 The catalina.log file is in TOMCAT_HOME/logs.  All standard out and
 standard error messages get routed to there by default.

 The Unix tail command with the -f option will allow you to watch the
 logfile as it is being written to, in real time.

 -Ben

 
 Original message:

 Hi,
 I'm a relatively new Tomcat user, running 4.0.4 (testing on Windows,
 deploying on Sun UNIX).  The UNIX servlet is having rare problems
 hanging, for which the exact cause is unknown.

 I'm trying to see if a session timeout can solve the problem, but have not
 been able to get it to work.  Numerous archives talk about this, and it
 seems like I'm doing what everyone suggests, but it's not working.

 In my web.xml file, I have the following, as a test of one-minute timeout:

   session-config
   session-timeout1/session-timeout
/session-config

 I have made a call the HttpSession.getMaxInactiveInterval, and it returns
 60 (seconds, I presume), so I believe the parameter is being applied.  I
 have tried 2 different approaches to simulate an inactive server:

 1)  Manually update a database row (but don't commit) before the servlet
 call, then have the servlet try to update the same row 2)  Use
 Thread.sleep(12)

 In both cases, the 1 minute timeout doesn't do anything.  So what
 constitutes an inactive session, for which this parameter was designed? 
 If it likely won't solve my problem, does anyone have an idea on how I can
 kill the request after a given amount of time?


 much thanks,

 -Ron


 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]

-- 
Ben Souther
F.W. Davison  Company, Inc.



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: definition/usage of session-timeout?

2003-11-25 Thread Justin Ruthenbeck
At 07:08 AM 11/25/2003, you wrote:
Ben,
   Thanks for the reply.  But I'm still unclear on why setting the 
timeout won't work for my situation.  What is the difference between an 
effectively idle session timing out, and cancelling a request?

Of course I agree that fixing the root problem would be preferable, but 
it's extremely hard to diagnose.  Putting in println's everywhere would 
in my case generate huge log file sizes, and I'll only try that as a 
last resort.

Can anyone suggest a different technique for simulating an inactive 
session, so that I can get session-timeout to work?
If your servlet is hanging, you need to find out what it's hanging 
on.  Get a thread dump from your JVM when your server is hung (or your 
request is hung) and it should be obvious what is going on (thread dump 
commands vary by platform -- see your JVM docs).  From what I've heard 
from you so far, this has absolutely nothing to do with session timeouts.

justin 

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


definition/usage of session-timeout?

2003-11-24 Thread WALKUP, RON [AG/1000]
Hi,
I'm a relatively new Tomcat user, running 4.0.4 (testing on Windows, deploying on 
Sun UNIX).  The UNIX servlet is having rare problems hanging, for which the exact 
cause is unknown.

I'm trying to see if a session timeout can solve the problem, but have not been able 
to get it to work.  Numerous archives talk about this, and it seems like I'm doing 
what everyone suggests, but it's not working.

In my web.xml file, I have the following, as a test of one-minute timeout:

  session-config
  session-timeout1/session-timeout
   /session-config

I have made a call the HttpSession.getMaxInactiveInterval, and it returns 60 (seconds, 
I presume), so I believe the parameter is being applied.  I have tried 2 different 
approaches to simulate an inactive server:

1)  Manually update a database row (but don't commit) before the servlet call, then 
have the servlet try to update the same row
2)  Use Thread.sleep(12)

In both cases, the 1 minute timeout doesn't do anything.  So what constitutes an 
inactive session, for which this parameter was designed?  If it likely won't solve 
my problem, does anyone have an idea on how I can kill the request after a given 
amount of time?


much thanks,

-Ron

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]