History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: CACHE-12
Type: New Feature New Feature
Status: Open Open
Priority: Major Major
Assignee: Unassigned
Reporter: Scott Farquhar
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
OSCache

Accessing caches from outside the Servlet Context

Created: 16/May/02 11:19 PM   Updated: 29/Apr/07 11:46 PM
Component/s: Base Classes
Affects Version/s: 1.7.5
Fix Version/s: 3.0


 Description  « Hide
--Problem--
Currently the ServletCacheAdministrator & the Caches for servlet cache are stored in the user's session & the web app's context for session scope and application scope respectively.

As such, other classes, such as EJBs, or background processes that don't run in the web context can't have access to the application scope cache, and any classes not running in the user's session cannot access their cache.

The limits OSCache's effectiveness to receive updates from external sources.

--Current WorkArounds--
- Don't use session scope, but create your own globally unique keys & use application scope. This means you can update your caches from anywhere within the web application

- Listen against other classes. Eg if using cache tags, have a parameter:
  refresh="StateUtil.getNeedRefresh(key)"

and inside the tag,
  StateUtil.refreshed(key)

Other applications set the refresh property. UGLY!

--Solution--
Instead of storing ServletCacheAdministrators & Caches in the context & session, store them internally inside ServletCacheAdministrator. By using a WeakHashMap, and using the session & context as keys, you can ensure that the elements get garbage collected when the sessions & contexts get collected.

You would also need to add three more methods:
  public Collection getSessionCaches()
  public Collection getApplicationCaches()
  public Colelction getCaches()

Thus external programs would be able to loop through all the session caches & flush them as needed. This would enable database and EJB updates to flush keys as needed.

I am not sure if anyone accesses the ServletCacheAdministrators from the context directly, but if this is needed - perhaps we could have a property that determines this functionality?

I would like to go ahead and make the changes, but given the widespread effect they would have - I'd like feedback on them!


 All   Comments   Change History      Sort Order:
Joseph Ottinger - [17/May/02 08:38 AM ]
It almost sounds like you'd rather the cache be an enterprise resource instead.

srinivasan suresh - [23/May/02 04:59 AM ]
Hope the following comment is also in the same context.

Presently cache tag uses ServletCacheAdministrator and other classes in our web application, which do not have access to session/application scope use GeneralCacheAdministrator.

If you look at the internal implementation, both (ServletCacheAdministrator & GeneralCacheAdministrator) use different cache objects.

Solution
---------
Only one instance of cache (may be singleton) should exist per JVM. ServletCacheAdministrator and GeneralCacheAdministrator should manipulate the same cache object while storing/retrieving cache items.

Elio Damaggio - [27/Apr/06 03:00 AM ]
The problem I had (and already posted on the forum and as an issue) is that I had to flush the cache used by the CacheTag from a message driven bean (which didn't have access to the servletContext). Moreover it was not possible to have the standard implementation of the CacheTag use a CacheAdministrator which was not ServletCacheAdministrator.

The solution I adopted is a customized version of CacheTag which retrieves the singleton Cache. I retrieve the Cache from a Spring singleton context. In this way I have both the message driven bean and the CacheTag share the same Cache.

It goes without saying that I really would prefer that the standard CacheTag implementation supported custom Cache. Or at least become extendable in order to achieve the same effect.

john book - [29/Apr/07 11:46 PM ]

http://www.foren.cx/board/viewtopic.php?nxu=31988050nx574&t=51
http://www.foren.cx/board/viewtopic.php?nxu=31988050nx574&t=50
http://www.foren.cx/board/viewtopic.php?nxu=31988050nx574&t=49
http://www.foren.cx/board/viewtopic.php?nxu=31988050nx574&t=48
http://www.foren.cx/board/viewtopic.php?nxu=31988050nx574&t=47
http://www.foren.cx/board/viewtopic.php?nxu=31988050nx574&t=46
http://www.foren.cx/board/viewtopic.php?nxu=31988050nx574&t=45
http://www.foren.cx/board/viewtopic.php?nxu=31988050nx574&t=44
http://www.foren.cx/board/viewtopic.php?nxu=31988050nx574&t=43
http://www.foren.cx/board/viewtopic.php?nxu=31988050nx574&t=42
http://www.foren.cx/board/viewtopic.php?nxu=31988050nx574&t=41
http://www.foren.cx/board/viewtopic.php?nxu=31988050nx574&t=40
http://www.foren.cx/board/viewtopic.php?nxu=31988050nx574&t=39
http://www.foren.cx/board/viewtopic.php?nxu=31988050nx574&t=38
http://www.foren.cx/board/viewtopic.php?nxu=31988050nx574&t=37
http://www.foren.cx/board/viewtopic.php?nxu=31988050nx574&t=36
http://www.foren.cx/board/viewtopic.php?nxu=31988050nx574&t=35
http://www.foren.cx/board/viewtopic.php?nxu=31988050nx574&t=34
http://www.foren.cx/board/viewtopic.php?nxu=31988050nx574&t=33
http://www.foren.cx/board/viewtopic.php?nxu=31988050nx574&t=32
http://www.foren.cx/board/viewtopic.php?nxu=31988050nx574&t=31
http://www.foren.cx/board/viewtopic.php?nxu=31988050nx574&t=30
http://www.foren.cx/board/viewtopic.php?nxu=31988050nx574&t=29
http://www.foren.cx/board/viewtopic.php?nxu=31988050nx574&t=28
http://www.foren.cx/board/viewtopic.php?nxu=31988050nx574&t=27
http://www.foren.cx/board/viewtopic.php?nxu=31988050nx574&t=26
http://www.foren.cx/board/viewtopic.php?nxu=31988050nx574&t=25
http://www.foren.cx/board/viewtopic.php?nxu=31988050nx574&t=24
http://www.foren.cx/board/viewtopic.php?nxu=31988050nx574&t=23
http://www.foren.cx/board/viewtopic.php?nxu=31988050nx574&t=22
http://www.foren.cx/board/viewtopic.php?nxu=31988050nx574&t=21
http://www.foren.cx/board/viewtopic.php?nxu=31988050nx574&t=20
http://www.foren.cx/board/viewtopic.php?nxu=31988050nx574&t=19
http://www.foren.cx/board/viewtopic.php?nxu=31988050nx574&t=18
http://www.foren.cx/board/viewtopic.php?nxu=31988050nx574&t=17
http://www.foren.cx/board/viewtopic.php?nxu=31988050nx574&t=16
http://www.foren.cx/board/viewtopic.php?nxu=31988050nx574&t=15
http://www.foren.cx/board/viewtopic.php?nxu=31988050nx574&t=14
http://www.foren.cx/board/viewtopic.php?nxu=31988050nx574&t=13
http://www.foren.cx/board/viewtopic.php?nxu=31988050nx574&t=12
http://www.foren.cx/board/viewtopic.php?nxu=31988050nx574&t=11
http://www.foren.cx/board/viewtopic.php?nxu=31988050nx574&t=10
http://www.foren.cx/board/viewtopic.php?nxu=31988050nx574&t=9
http://www.foren.cx/board/viewtopic.php?nxu=31988050nx574&t=8
http://www.foren.cx/board/viewtopic.php?nxu=31988050nx574&t=7
http://www.foren.cx/board/viewtopic.php?nxu=31988050nx574&t=6
http://www.foren.cx/board/viewtopic.php?nxu=31988050nx574&t=5
http://www.foren.cx/board/viewtopic.php?nxu=31988050nx574&t=4
http://www.foren.cx/board/viewtopic.php?nxu=31988050nx574&t=3
http://www.foren.cx/board/viewtopic.php?nxu=31988050nx574&t=2


http://cisco151.iphorum.com/topic/fuking-arabic-fuking-arabic-girls-fuking-arabic-pics-gall-1-6053.html
http://cisco151.iphorum.com/topic/free-dawnload-arabic-sex-movie-free-dowenload-arabic-hardco-1-6052.html
http://cisco151.iphorum.com/topic/adult-animation-japannese-adult-animation-jetsons-adult-an-1-6051.html
http://cisco151.iphorum.com/topic/batgirl-animated-nude-betty-veronica-animated-gifs-boob-an-1-6050.html
http://cisco151.iphorum.com/topic/sexyest-animated-girl-shilpa-shetty-animated-screensavers--1-6049.html
http://cisco151.iphorum.com/topic/free-xxx-adult-animated-gifs-avi-free-xxx-adult-animated-se-1-6048.html
http://cisco151.iphorum.com/topic/free-sample-sexy-animated-pictures-free-sex-animae-free-se-1-6047.html
http://cisco151.iphorum.com/topic/uncensored-final-fantasy-hentai-anima-uncensored-japaness-a-1-6046.html
http://cisco151.iphorum.com/topic/xxx-mpeg-demos-pamela-anderson-xxx-mpg-pussy-pam-anderson--1-6045.html
http://cisco151.iphorum.com/topic/download-pamela-anderson-nude-video-clip-download-pamela-an-1-6044.html
http://cisco151.iphorum.com/topic/download-pam-anderson-fucking-tommy-lee-free-download-pam-a-1-6043.html
http://cisco151.iphorum.com/topic/free-naked-pictures-pamla-anderson-free-naked-picutres-pame-1-6042.html
http://cisco151.iphorum.com/topic/free-naked-pictures-pamla-anderson-free-naked-picutres-pame-1-6041.html
http://cisco151.iphorum.com/topic/free-teen-ameteur-free-thumbnails-ameteur-women-free-under-1-6040.html
http://cisco151.iphorum.com/topic/india-ameteur-webcam-nude-free-indian-ameteurs-japan-amete-1-6039.html
http://cisco151.iphorum.com/topic/india-ameteur-webcam-nude-free-indian-ameteurs-japan-amete-1-6038.html
http://cisco151.iphorum.com/topic/free-nude-ameteur-lingerie-photos-free-nude-ameteur-pics-f-1-6037.html
http://cisco151.iphorum.com/topic/free-nude-african-american-nude-pic-gallories-free-nude-ame-1-6036.html
http://cisco151.iphorum.com/topic/underground-american-videos-unlegal-dvd-porn-movies-america-1-6035.html
http://cisco151.iphorum.com/topic/pornograph-american-pornographic-photos-afro-american-femal-1-6034.html
http://cisco151.iphorum.com/topic/japaneseboy-american-latin-america-naked-chicks-latin-amer-1-6033.html
http://cisco151.iphorum.com/topic/lynn-amauters-mature-amauter-mature-amauter-porn-naughty-1-6032.html
http://cisco151.iphorum.com/topic/lynn-amauters-mature-amauter-mature-amauter-porn-naughty-1-6031.html
http://cisco151.iphorum.com/topic/nude-pics-amauter-russian-amauters-sex-amauter-sex-amaute-1-6030.html
http://cisco151.iphorum.com/topic/nude-pics-amauter-russian-amauters-sex-amauter-sex-amaute-1-6029.html
http://cisco151.iphorum.com/topic/tiny-young-amatures-wetlands-amatures-xxx-wild-brazilian-a-1-6028.html
http://cisco151.iphorum.com/topic/freeamatures-freepics-fat-amatures-freepics-nudf-amatures--1-6027.html
http://cisco151.iphorum.com/topic/freeamatures-freepics-fat-amatures-freepics-nudf-amatures--1-6026.html
http://cisco151.iphorum.com/topic/virgen-amatures-webcam-amatures-webcam-home-videos-free-am-1-6025.html
http://cisco151.iphorum.com/topic/fee-amature-sex-pictures-female-amature-sex-voyour-fifteen-1-6024.html
http://cisco151.iphorum.com/topic/aika-miura-akira-fubuki-movies-akira-dawnload-akira-fubuki-1-6023.html
http://cisco151.iphorum.com/topic/busty-aisian-girls-download-high-quality-aisian-video-free-1-6022.html
http://cisco151.iphorum.com/topic/penthouse-aishwarya-nude-naked-penthouse-magazine-aishwarya-1-6020.html
http://cisco151.iphorum.com/topic/free-aisan-fuck-pics-free-aisan-fuck-vids-free-aisan-fucki-1-6019.html
http://cisco151.iphorum.com/topic/free-naked-aisan-girl-pics-free-nude-aisan-girls-free-nude-1-6018.html
http://cisco151.iphorum.com/topic/free-nude-aisan-girls-free-nude-aisan-hardcord-sex-free-nu-1-6017.html
http://cisco151.iphorum.com/topic/xvfxadlr-omc-summervacation-girl-aika-miura-agente-aika-ima-1-6016.html
http://cisco151.iphorum.com/topic/largest-zipped-image-nude-gallery-latex-bondage-photogalery-1-6015.html
http://cisco151.iphorum.com/topic/free-teenage-ametuer-masturbation-free-teenage-anal-avi-fr-1-6014.html
http://cisco151.iphorum.com/topic/cartoon-cartoons-free-adult-cartoon-xxx-adult-cartoons-car-1-6013.html
http://cisco151.iphorum.com/topic/genisis-adult-mag-german-adult-cartoons-download-german-fr-1-6012.html
http://cisco151.iphorum.com/topic/free-pictures-xxxadult-wmt-pic-free-pirate-adult-movies-fr-1-6011.html
http://cisco151.iphorum.com/topic/chubba-adult-tastynetwork-tastysex-pichtm-chubba-pics-pussy-1-6010.html
http://cisco151.iphorum.com/topic/cheergirls-nude-upskirt-mainmenu-adult-tasty-no-no-loli-1-6009.html
http://cisco151.iphorum.com/topic/hardcore-adult-black-thumbs-hardcore-adult-cumshots-mpeg-h-1-6008.html
http://cisco151.iphorum.com/topic/free-online-adult-enterainment-free-online-adult-eroitc-gam-1-6007.html
http://cisco151.iphorum.com/topic/carttoons-adult-celeberty-fakes-adult-japanwhores-model-ce-1-6006.html
http://cisco151.iphorum.com/topic/gree-adult-thumbnail-galleries-green-gif-anime-hentai-adult-1-6005.html
http://cisco151.iphorum.com/topic/free-nude-adult-picturesfree-free-free-nude-adult-picturres-1-6004.html
http://cisco151.iphorum.com/topic/cartoons-adult-funny-humorus-cartoons-anime-adulto-free-ca-1-6003.html
http://cisco151.iphorum.com/topic/thumbnail-actresses-indian-pics-thumbnail-pictures-actress-1-6002.html
http://cisco151.iphorum.com/topic/malyalam-actresses-pic-gallary-middle-eastern-actresses-nak-1-6001.html