Re: Help understanding Session System Properties
-BEGIN PGP SIGNED MESSAGE- Hash: SHA256 Filipe, On 7/24/14, 2:53 PM, Felipe Jaekel wrote: > My session timeout is 15 minutes. > > I have thread that may set a session attribute, but it run only > once after user login and take approximately 1 minute to complete. > > My applications are JSF based, and most of managed beans are view > scoped. The majority of requests is completed is less than 1 > minute. Ok, so you have a background thread that can work on the session even when there are no currently-executing requests that refer to it? I'm not sure if you can tickle the session to update its last-used date without reaching-into the Tomcat-specific APIs. You might be able to make a lookback request from inside the server to its own local connector and reference the session just to send a "keep alive" for the session while you work on it. It's ugly but it should work. - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1 Comment: GPGTools - http://gpgtools.org Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQIcBAEBCAAGBQJT0mlNAAoJEBzwKT+lPKRYFv8QAJBbVh1a6ZjQ2FIndg0e6g0c /p0fnJi4u7pQIfygb+HspRa0uE4IoknPlQvYJuI/CZ9WXGbcJlxg0wojZbnldTkB /+WMaUDAr197iE/i1J9gVTlHBn5wIoKefQ4SSsP4b2hg37AhGvyhh47fHVt/d9mC TcLVgrcydlai/kyM8oxP23HIfXj5/v+HDrADYUMLy+7QDR42g2B8Q0Biuw1ezu8W BeK31ZPtn9veGoUMA/eUdh14EBplC2BTzeerTxERQNj3FTCPAfnyZthAIqB7wLIw ubdEMNZ+ZMPrcT5lWKyoakGiISqzYXfy+PkWK+XDU7n4zGAgpYDfI2kQ8SnVT/E6 7f0KFl6OHxEBoqpbvLImuxhj1qLCvXSBWlfbLcWdiwzutYMhKzNyqaCRgMdAa1Ea Z5VHp18oA8QDbrxx4C5ipcS5xFLSnwQYYH4vqiD2adeKmtXEhvd5CwPas1TG0qtS RcrOtOm/TsOQJeWqBh8b0yJmXdqdGPjYgHJy3FXygME1tTFpoPkYRcTuIgkiy5WY +JaPGMidOXi63ZxX2eZcpfBhfzkQZ5sLIUrEVnksMV+yB3GWJog2kek6emyIaDvT oqRtuEHEOXI3/CNUN1YLEj5St8408qsVHZExqtuYL+78YcUidJcMsCEbQenN3y2v MHKAAQdT+mycs7BFSGNB =Pqmh -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Help understanding Session System Properties
Thanks for the replies. My session timeout is 15 minutes. I have thread that may set a session attribute, but it run only once after user login and take approximately 1 minute to complete. My applications are JSF based, and most of managed beans are view scoped. The majority of requests is completed is less than 1 minute. 2014-07-22 17:44 GMT-03:00 Christopher Schultz : > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA256 > > Felipe, > > On 7/22/14, 10:36 AM, Felipe Jaekel wrote: > > I have a simple authentication logic in my applications, where I > > store the current user in the session and check with a filter if > > the current user value is not null. > > > > Eventually I see some null pointer exceptions in my Tomcat 7.0.47 > > that happened in JSF managed beans because the current user value > > was null. > > > > The problem is that the stackTrace shows that login filter was > > executed correctly, so I guess the session timed out right after > > the getAttribute() call in the filter, which would explain why > > there still was value in the filter but not in the managed bean. > > Is your session timeout so low that a session could time out during > the execution of a single request? > > > After some research I found this: > > http://tomcat.apache.org/tomcat-7.0-doc/config/systemprops.html#Sessions > > > > Would org.apache.catalina.session.StandardSession.ACTIVITY_CHECK > > solve this problem? > > If the problem is that your requests are taking longer than the > session timeout (default: 30 minutes), then yes, this will help. > > > What about > > org.apache.catalina.core.StandardHostValve.ACCESS_SESSION > > Perhaps. Do you have lots of requests whose code doesn't actually call > request.getSession()? > > > and > > org.apache.catalina.session.StandardSession.LAST_ACCESS_AT_START? > > Perhaps, depending on whether you really have requests that run so > long that the session can time-out during their execution. > > What is your session timeout value (in minutes)? How long does a > typical request/response transaction take? How often do they occur? > > - -chris > -BEGIN PGP SIGNATURE- > Version: GnuPG v1 > Comment: GPGTools - http://gpgtools.org > Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ > > iQIcBAEBCAAGBQJTzs0qAAoJEBzwKT+lPKRYyroQAIP0DikrED8AWbu0WuB7pDnv > icK82YnEHVEZwHWeiKl03PV7vZsTkPzG6v+aDP+Yb+DaCuxlCpHN3hGvyT2a8x4x > oDe82O47B/6cMTzCv/JubK06EWYJOfOGtXEYLRHKSye82+v2wHrkwVdFe3JINu0N > ka7CKHFuSPIsAN0HPxrvI0lWEOCJeBffLrb8+mFjixLmQHaA09NEthT9Xr6ohWrq > ZuugHFAo/D+2zW6UGmuYuwU+BkT6HQ13ZuBkyfAl/N/ZylovIde53fxKgWrSMSa3 > ao/9ZMIr9Ig64U9cUyB62RFiJ/kg2piJmq3TCL2UC9zzEmAc0/SpbazO/yAUID8y > +txrwpOfzxYIMZy0iH7aW5FH7gqdSpv/LKbVumPZlcVleBdr9J0AdBncNedoAw9Y > 3T6N2A4KiQDVHU2/f1NBmW+HOWu9r2a9mJN3rQrM+4Lf12NTFk3p6oyyZDkJuVNm > 8SPvZR90xws413TEAWt3IJTVoG8diUl873GZzHzj4HdvE39mp5gAzN+Nnhi2Meqs > ro2Rf6/qfdkEM/R0yvAJVFyeyFSjQvFpSphTvAzDxu1IIiJqQ/GvLKQ6eVgOLOM/ > vsPrksjTJ93KPx4iWHjSm6PgvyLc9R5RZVn1MLcROKpidNLwxJEp6wDO27cYj+GL > 8NOX+YMukTJnFebPtrIW > =cqiq > -END PGP SIGNATURE- > > - > To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org > For additional commands, e-mail: users-h...@tomcat.apache.org > >
Re: Help understanding Session System Properties
-BEGIN PGP SIGNED MESSAGE- Hash: SHA256 Felipe, On 7/22/14, 10:36 AM, Felipe Jaekel wrote: > I have a simple authentication logic in my applications, where I > store the current user in the session and check with a filter if > the current user value is not null. > > Eventually I see some null pointer exceptions in my Tomcat 7.0.47 > that happened in JSF managed beans because the current user value > was null. > > The problem is that the stackTrace shows that login filter was > executed correctly, so I guess the session timed out right after > the getAttribute() call in the filter, which would explain why > there still was value in the filter but not in the managed bean. Is your session timeout so low that a session could time out during the execution of a single request? > After some research I found this: > http://tomcat.apache.org/tomcat-7.0-doc/config/systemprops.html#Sessions > > Would org.apache.catalina.session.StandardSession.ACTIVITY_CHECK > solve this problem? If the problem is that your requests are taking longer than the session timeout (default: 30 minutes), then yes, this will help. > What about > org.apache.catalina.core.StandardHostValve.ACCESS_SESSION Perhaps. Do you have lots of requests whose code doesn't actually call request.getSession()? > and > org.apache.catalina.session.StandardSession.LAST_ACCESS_AT_START? Perhaps, depending on whether you really have requests that run so long that the session can time-out during their execution. What is your session timeout value (in minutes)? How long does a typical request/response transaction take? How often do they occur? - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1 Comment: GPGTools - http://gpgtools.org Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQIcBAEBCAAGBQJTzs0qAAoJEBzwKT+lPKRYyroQAIP0DikrED8AWbu0WuB7pDnv icK82YnEHVEZwHWeiKl03PV7vZsTkPzG6v+aDP+Yb+DaCuxlCpHN3hGvyT2a8x4x oDe82O47B/6cMTzCv/JubK06EWYJOfOGtXEYLRHKSye82+v2wHrkwVdFe3JINu0N ka7CKHFuSPIsAN0HPxrvI0lWEOCJeBffLrb8+mFjixLmQHaA09NEthT9Xr6ohWrq ZuugHFAo/D+2zW6UGmuYuwU+BkT6HQ13ZuBkyfAl/N/ZylovIde53fxKgWrSMSa3 ao/9ZMIr9Ig64U9cUyB62RFiJ/kg2piJmq3TCL2UC9zzEmAc0/SpbazO/yAUID8y +txrwpOfzxYIMZy0iH7aW5FH7gqdSpv/LKbVumPZlcVleBdr9J0AdBncNedoAw9Y 3T6N2A4KiQDVHU2/f1NBmW+HOWu9r2a9mJN3rQrM+4Lf12NTFk3p6oyyZDkJuVNm 8SPvZR90xws413TEAWt3IJTVoG8diUl873GZzHzj4HdvE39mp5gAzN+Nnhi2Meqs ro2Rf6/qfdkEM/R0yvAJVFyeyFSjQvFpSphTvAzDxu1IIiJqQ/GvLKQ6eVgOLOM/ vsPrksjTJ93KPx4iWHjSm6PgvyLc9R5RZVn1MLcROKpidNLwxJEp6wDO27cYj+GL 8NOX+YMukTJnFebPtrIW =cqiq -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Help understanding Session System Properties
On 7/22/2014 9:36 AM, Felipe Jaekel wrote: I have a simple authentication logic in my applications, where I store the current user in the session and check with a filter if the current user value is not null. Eventually I see some null pointer exceptions in my Tomcat 7.0.47 that happened in JSF managed beans because the current user value was null. The problem is that the stackTrace shows that login filter was executed correctly, so I guess the session timed out right after the getAttribute() call in the filter, which would explain why there still was value in the filter but not in the managed bean. After some research I found this: http://tomcat.apache.org/tomcat-7.0-doc/config/systemprops.html#Sessions Would org.apache.catalina.session.StandardSession.ACTIVITY_CHECK solve this problem? What about org.apache.catalina.core.StandardHostValve.ACCESS_SESSION and org.apache.catalina.session.StandardSession.LAST_ACCESS_AT_START? Thanks Hi, Felipe- What's your session timeout setting? IIRC, the session timer is reset every time a new request associated with that session is received. Is the session object accessed outside the scope of processing a request (i.e. from a thread you've created)? -Terence Bandoian - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Help understanding Session System Properties
I have a simple authentication logic in my applications, where I store the current user in the session and check with a filter if the current user value is not null. Eventually I see some null pointer exceptions in my Tomcat 7.0.47 that happened in JSF managed beans because the current user value was null. The problem is that the stackTrace shows that login filter was executed correctly, so I guess the session timed out right after the getAttribute() call in the filter, which would explain why there still was value in the filter but not in the managed bean. After some research I found this: http://tomcat.apache.org/tomcat-7.0-doc/config/systemprops.html#Sessions Would org.apache.catalina.session.StandardSession.ACTIVITY_CHECK solve this problem? What about org.apache.catalina.core.StandardHostValve.ACCESS_SESSION and org.apache.catalina.session.StandardSession.LAST_ACCESS_AT_START? Thanks