Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Caching

 
amol bakre
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • 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
 
manoj r patil
Ranch Hand
Posts: 182
  • Mark post as helpful
  • send pies
  • 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.
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moving to... Spring?

Struts has nothing to do with data retrieval or caching.
 
dileep keely
Ranch Hand
Posts: 108
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator



Hope this will help!!
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • 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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic