Re: [OFFTOPIC] Removing attribute from all HttpSessions
Bad caching strategy. Try using a singleton cache backed by a HashMap. Have an invalidation method that takes a pagekey as argument. Create a simple get(pagekey) that checks for invalidation and refills the cache entry when necessary. No need to go iterating over sessions... Just my $0.02 :-) Michiel Allistair Crossley wrote: Hey, I am putting a page caching stategy into place per user session. However, there are times when I need to refresh all the caches for all users. For example, let's say 5 users have a cached version of page 5. An external event causes page 5 to invalidate. I need an effective strategy to flush all sessions with page 5 cached. Thoughts appreciated, Allistair. FONT SIZE=1 FACE=VERDANA,ARIAL COLOR=BLUE --- QAS Ltd. Developers of QuickAddress Software a href=http://www.qas.com;www.qas.com/a Registered in England: No 2582055 Registered in Australia: No 082 851 474 --- /FONT - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Michiel Toneman Software Engineer Bibit Global Payment Services Regulierenring 10 3981 LB Bunnik [EMAIL PROTECTED] Tel. +31-30-6595168 Fax +31-30-6564464 http://www.bibit.com/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: [OFFTOPIC] Removing attribute from all HttpSessions
I should have explained some more I guess. I am currently using OSCACHE at the UI layer to cached search results strings per page ID in application scope. It is very effective indeed. The search results come from a content management system. When users interact with the CMS, events are fired to a listener and I can determine which page in the cache needs updating. However I realised this morning that search results per row are security contolled. Therefore user A's search results for page 5 are not necessarily the same as user B's. Hence the need for user-level caching. I used my own caching Hashes before but OSCACHE is very powerful. OSCACHE's cache JSP tag also provides only application and session scope, therefore I was thinking session caching must be the only other solution for my problem. But I need to be able to programmatically flush many user sessions. Perhaps I need to store the caches created per session somewhere so I can grab them. Allistair Crossley -Original Message- From: Michiel Toneman [mailto:[EMAIL PROTECTED] Sent: 19 August 2004 09:57 To: Tomcat Users List Subject: Re: [OFFTOPIC] Removing attribute from all HttpSessions Bad caching strategy. Try using a singleton cache backed by a HashMap. Have an invalidation method that takes a pagekey as argument. Create a simple get(pagekey) that checks for invalidation and refills the cache entry when necessary. No need to go iterating over sessions... Just my $0.02 :-) Michiel Allistair Crossley wrote: Hey, I am putting a page caching stategy into place per user session. However, there are times when I need to refresh all the caches for all users. For example, let's say 5 users have a cached version of page 5. An external event causes page 5 to invalidate. I need an effective strategy to flush all sessions with page 5 cached. Thoughts appreciated, Allistair. FONT SIZE=1 FACE=VERDANA,ARIAL COLOR=BLUE --- QAS Ltd. Developers of QuickAddress Software a href=http://www.qas.com;www.qas.com/a Registered in England: No 2582055 Registered in Australia: No 082 851 474 --- /FONT - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Michiel Toneman Software Engineer Bibit Global Payment Services Regulierenring 10 3981 LB Bunnik [EMAIL PROTECTED] Tel. +31-30-6595168 Fax +31-30-6564464 http://www.bibit.com/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] FONT SIZE=1 FACE=VERDANA,ARIAL COLOR=BLUE --- QAS Ltd. Developers of QuickAddress Software a href=http://www.qas.com;www.qas.com/a Registered in England: No 2582055 Registered in Australia: No 082 851 474 --- /FONT - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [OFFTOPIC] Removing attribute from all HttpSessions
Look at the SessionListeners to register all the sessions that match your criteria into a map. Then whatever is listening on your invalidation strategy can update the map. (Actually - the sessions in the map) -Tim Allistair Crossley wrote: Hey, I am putting a page caching stategy into place per user session. However, there are times when I need to refresh all the caches for all users. For example, let's say 5 users have a cached version of page 5. An external event causes page 5 to invalidate. I need an effective strategy to flush all sessions with page 5 cached. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: [OFFTOPIC] Removing attribute from all HttpSessions
Thanks Tim. Done that ... any reason why sessionCreated is always called twice? 2004-08-19 12:31:02,920 - DEBUG (com.qas.newmedia.intranet.iq.IQSessionListener:31) - new session: 0E3C9F21B145FF21903D8D35E540217F 2004-08-19 12:31:02,920 - DEBUG (com.qas.newmedia.intranet.iq.IQSessionListener:31) - new session: 0E3C9F21B145FF21903D8D35E540217F Also, sessionDestroyed I am guessing is not actually called when a user closes their browser but on session timeout after inactivity correct? Allistair Crossley -Original Message- From: Tim Funk [mailto:[EMAIL PROTECTED] Sent: 19 August 2004 11:48 To: Tomcat Users List Subject: Re: [OFFTOPIC] Removing attribute from all HttpSessions Look at the SessionListeners to register all the sessions that match your criteria into a map. Then whatever is listening on your invalidation strategy can update the map. (Actually - the sessions in the map) -Tim Allistair Crossley wrote: Hey, I am putting a page caching stategy into place per user session. However, there are times when I need to refresh all the caches for all users. For example, let's say 5 users have a cached version of page 5. An external event causes page 5 to invalidate. I need an effective strategy to flush all sessions with page 5 cached. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] FONT SIZE=1 FACE=VERDANA,ARIAL COLOR=BLUE --- QAS Ltd. Developers of QuickAddress Software a href=http://www.qas.com;www.qas.com/a Registered in England: No 2582055 Registered in Australia: No 082 851 474 --- /FONT - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [OFFTOPIC] Removing attribute from all HttpSessions
If its in web.xml twice - it would be called twice. sessionDestroyed is called when the container kills the session. Which is done during session timeout or session.invalidate() -Tim Allistair Crossley wrote: Thanks Tim. Done that ... any reason why sessionCreated is always called twice? 2004-08-19 12:31:02,920 - DEBUG (com.qas.newmedia.intranet.iq.IQSessionListener:31) - new session: 0E3C9F21B145FF21903D8D35E540217F 2004-08-19 12:31:02,920 - DEBUG (com.qas.newmedia.intranet.iq.IQSessionListener:31) - new session: 0E3C9F21B145FF21903D8D35E540217F Also, sessionDestroyed I am guessing is not actually called when a user closes their browser but on session timeout after inactivity correct? Allistair Crossley -Original Message- From: Tim Funk [mailto:[EMAIL PROTECTED] Sent: 19 August 2004 11:48 To: Tomcat Users List Subject: Re: [OFFTOPIC] Removing attribute from all HttpSessions Look at the SessionListeners to register all the sessions that match your criteria into a map. Then whatever is listening on your invalidation strategy can update the map. (Actually - the sessions in the map) -Tim Allistair Crossley wrote: Hey, I am putting a page caching stategy into place per user session. However, there are times when I need to refresh all the caches for all users. For example, let's say 5 users have a cached version of page 5. An external event causes page 5 to invalidate. I need an effective strategy to flush all sessions with page 5 cached. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]