Polling servlet and session expiration - avoid calling request.getSession() ?
hi all, I have to implement a polling mechanism that repeatedly sends a request to a servlet. This servlet doesn't need the user session, and i don't want these requests to update the session's lastAccessedTime, thus preventing regular session timeout when the user isn't doing anything else. I've already had a look at the archives, and found possible solutions using a filter, and that's ok, but... i seemed to remember that, in a servlet, you have to call request.getSession() to "touch" the session and reset the timeout counter. So, i made a simple test servlet that does not call req.getSession(), tried under both TC5.5.25 & TC6.0.18, and it seems to work: the session normally expires when it's time to, ignoring the requests to that servlet. Now my question is: can this be considered a reliable solution? The sevlet spec seems to state that the accessed time should be updated as soon as the request comes in. Additionally, i've had a look at the sources (5.5.25 & 6.0.18) and found this comment in org/apache/catalina/Session.java: /** * Update the accessed time information for this session. This method * should be called by the context when a request comes in for a particular * session, even if the application does not reference it. */ public void access(); ...so i'm afraid the answer is no, but i'd like some "official" advice about that. Thanks alberto - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Polling servlet and session expiration - avoid calling request.getSession() ?
On 01/09/2011 12:52 AM, Konstantin Kolinko wrote: > [1] > http://tomcat.apache.org/tomcat-6.0-doc/config/systemprops.html#Specification Oops! sorry, i've missed that one! Now it's perfectly clear. Thanks for your help. Alberto - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
jk_translate::mod_jk.c (3033): missing uri map for
On our suse webserver that was working I have upgraded apache to v2.2.6. I got myself also a new mod_jk. However mod_jk is now failing with : jk_translate::mod_jk.c (3033): missing uri map for bla Has the config been changed between versions ? Ours is the minimal setup. Configfiles virtuallly identical as what you find in the faqs etc... There is no activity on port 8009, tomcat gets nothing. mod_jk.log [Tue Jan 29 17:35:44.224 2008] [4023:1018793104] [trace] init::jk_ajp13_worker.c (48): enter [Tue Jan 29 17:35:44.224 2008] [4023:1018793104] [trace] ajp_init::jk_ajp_common.c (2324): enter [Tue Jan 29 17:35:44.224 2008] [4023:1018793104] [debug] ajp_init::jk_ajp_common.c (2380): setting endpoint options: [Tue Jan 29 17:35:44.224 2008] [4023:1018793104] [debug] ajp_init::jk_ajp_common.c (2383): keepalive: 0 [Tue Jan 29 17:35:44.224 2008] [4023:1018793104] [debug] ajp_init::jk_ajp_common.c (2387): timeout: 0 [Tue Jan 29 17:35:44.224 2008] [4023:1018793104] [debug] ajp_init::jk_ajp_common.c (2391): buffer size: 0 [Tue Jan 29 17:35:44.224 2008] [4023:1018793104] [debug] ajp_init::jk_ajp_common.c (2395): pool timeout: 0 [Tue Jan 29 17:35:44.224 2008] [4023:1018793104] [debug] ajp_init::jk_ajp_common.c (2399): connect timeout: 0 [Tue Jan 29 17:35:44.224 2008] [4023:1018793104] [debug] ajp_init::jk_ajp_common.c (2403): reply timeout: 0 [Tue Jan 29 17:35:44.224 2008] [4023:1018793104] [debug] ajp_init::jk_ajp_common.c (2407): prepost timeout: 0 [Tue Jan 29 17:35:44.224 2008] [4023:1018793104] [debug] ajp_init::jk_ajp_common.c (2411): recovery options: 0 [Tue Jan 29 17:35:44.224 2008] [4023:1018793104] [debug] ajp_init::jk_ajp_common.c (2415): retries: 2 [Tue Jan 29 17:35:44.224 2008] [4023:1018793104] [debug] ajp_init::jk_ajp_common.c (2419): max packet size: 8192 [Tue Jan 29 17:35:44.224 2008] [4023:1018793104] [trace] ajp_create_endpoint_cache::jk_ajp_common.c (2279): enter [Tue Jan 29 17:35:44.224 2008] [4023:1018793104] [debug] ajp_create_endpoint_cache::jk_ajp_common.c (2288): setting connection pool size to 1 with min 1 [Tue Jan 29 17:35:44.224 2008] [4023:1018793104] [trace] ajp_create_endpoint_cache::jk_ajp_common.c (2312): exit [Tue Jan 29 17:35:44.224 2008] [4023:1018793104] [trace] ajp_init::jk_ajp_common.c (2451): exit [Tue Jan 29 17:35:44.224 2008] [4023:1018793104] [trace] init::jk_ajp13_worker.c (54): exit [Tue Jan 29 17:35:44.224 2008] [4023:1018793104] [trace] wc_create_worker::jk_worker.c (197): exit [Tue Jan 29 17:35:44.224 2008] [4023:1018793104] [trace] build_worker_map::jk_worker.c (269): exit [Tue Jan 29 17:35:44.224 2008] [4023:1018793104] [trace] wc_open::jk_worker.c (87): exit [Tue Jan 29 17:35:44.224 2008] [4023:1018793104] [info] init_jk::mod_jk.c (2825): mod_jk/1.2.26 initialized [Tue Jan 29 17:35:44.228 2008] [4029:1018793104] [trace] jk_child_init::mod_jk.c (2726): enter [Tue Jan 29 17:35:44.228 2008] [4029:1018793104] [trace] do_shm_open::jk_shm.c (337): enter [Tue Jan 29 17:35:44.228 2008] [4029:1018793104] [debug] do_shm_open::jk_shm.c (457): Attached shared memory [2] size=28672 free=28672 addr=0x2ad23be99000 [Tue Jan 29 17:35:44.228 2008] [4029:1018793104] [debug] do_shm_open::jk_shm.c (471): Reseting the shared memory for child 2 [Tue Jan 29 17:35:44.228 2008] [4029:1018793104] [trace] do_shm_open_lock::jk_shm.c (248): enter [Tue Jan 29 17:35:44.228 2008] [4029:1018793104] [debug] do_shm_open_lock::jk_shm.c (262): Duplicated shared memory lock /Storage/var/run/jk-shm-file.4023.lock [Tue Jan 29 17:35:44.228 2008] [4029:1018793104] [trace] do_shm_open_lock::jk_shm.c (264): exit [Tue Jan 29 17:35:44.228 2008] [4029:1018793104] [trace] do_shm_open::jk_shm.c (498): exit [Tue Jan 29 17:35:44.228 2008] [4029:1018793104] [debug] jk_child_init::mod_jk.c (2730): Attached shm:/Storage/var/run/jk-shm-file.4023 (28672 bytes) [Tue Jan 29 17:35:44.228 2008] [4029:1018793104] [debug] jk_child_init::mod_jk.c (2740): Initialized mod_jk/1.2.26 [Tue Jan 29 17:35:44.228 2008] [4029:1018793104] [trace] jk_child_init::mod_jk.c (2741): exit [Tue Jan 29 17:35:44.231 2008] [4030:1018793104] [trace] jk_child_init::mod_jk.c (2726): enter [Tue Jan 29 17:35:44.231 2008] [4030:1018793104] [trace] do_shm_open::jk_shm.c (337): enter [Tue Jan 29 17:35:44.231 2008] [4030:1018793104] [debug] do_shm_open::jk_shm.c (457): Attached shared memory [3] size=28672 free=28672 addr=0x2ad23be99000 [Tue Jan 29 17:35:44.231 2008] [4030:1018793104] [debug] do_shm_open::jk_shm.c (471): Reseting the s