aspose file tools
The moose likes Java in General and the fly likes Local Cacheing of data from database and using it Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Java in General
Reply Bookmark "Local Cacheing of data from database and using it" Watch "Local Cacheing of data from database and using it" New topic
Author

Local Cacheing of data from database and using it

raja patil
Greenhorn

Joined: May 26, 2008
Posts: 20
Hello,

I am new to java and writing my first spring, ibatis, blazeDS, flex 4 application.
In a Remote Object service method I am firing a query returning a large dataset and collecting it into a arraylist.
Then I am iterating through that list and refering other data from database over and over again. This is giving me
a performance hit since for every query there is connection and data retrieval overhead. Since the referred data is small
is it possible to store it in local in memory database and retrieve it by using multiple fields ?

Earlier when I was coding in delphi we used to use in memory tables with many fields and in the beginning of large
processing we used to query RDBMS for those table and save data in memory tables then fire main query
which was returning large dataset and the we were iterating through that dataset and whenever reference data was
needed we used seek memory tables with required fields and get the reference record for further manipulation.
this technique was giving us lot of performance improvement.

I would like to do same in java how can I do that ?

Thanks and best regards

Raja
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 26173
    
  66

Raja,
You can use Spring to set up caching with EH Cache. See spring caching for articles and examples.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
 
I agree. Here's the link: http://zeroturnaround.com/jrebel
 
subject: Local Cacheing of data from database and using it
 
Similar Threads
Query Optimization
Special considerations for working with large local datasource
Design help for the Data Loaders
Optimizing a database
Hibernate performance issues using huge databases