• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Caching

 
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I needed to cache some values from the DB into the application as they are static values and used across the application. I am using struts2 and springs jdbc for DB access. I was wondering where should be the best place to do this, is there any facility in struts 2 or should i use springs to do this, tried to find something about spring caching, but looks complicated..lol..or should simply use an onload servlet make pure jdbc calls and cache the parameters / values, which i thought would not be the wisest choice..

Would appreciate suggestions, also where could i find something on spring caching that is simple to understand and write as the job required is pretty simple..

Regards,
Am
 
Ranch Hand
Posts: 182
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
May be you can take a look at jboss cache which is open source server side implementation for tree based caching.
 
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Moving to... Spring?

Struts has nothing to do with data retrieval or caching.
 
Ranch Hand
Posts: 112
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator



Hope this will help!!
 
ranger
Posts: 17347
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This actually isn't Spring specific either.

you can use any Caching product out there. If you wanted to preload data into the cache, then you could create a Spring bean for it and make an init method. In xml that would be <bean init-method="nameOfMethodToRun"/>

or put the

@PostConstruct annotation on the method you want to run. and include
<context:annotation-config/> in your xml


By the way the framework is the Spring Framework, there is no plural like there is in Struts.

Mark
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic