permaculture playing cards*
The moose likes Spring and the fly likes Caching Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Frameworks » Spring
Bookmark "Caching" Watch "Caching" New topic
Author

Caching

amol bakre
Greenhorn

Joined: May 21, 2001
Posts: 25
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

Joined: Jun 06, 2002
Posts: 181
May be you can take a look at jboss cache which is open source server side implementation for tree based caching.


love your job and not your company;
...because you never know when your company will stop loving you!
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Moving to... Spring?

Struts has nothing to do with data retrieval or caching.
dileep keely
Ranch Hand

Joined: Jun 28, 2010
Posts: 91



Hope this will help!!
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17249
    
    6

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


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Caching
 
Similar Threads
how to set an object in Application scope
apache tomcat performance tuning (caching)
Concurrency and caching
Local caching architecture/choices
jsp caching and result caching in iAS