title: caching readonly data for java application
body: <p>I have a database which has around 150K records of data with a primary key on the table. The data size for each record will take less than 1kB. The processing time for constructing a POJO from the DB record takes about 1-2 secs(there is some business logic that takes too much time). This is read-only data. Hence I'm planning to implement caching the data. What I'm thinking to do is. Load the data in subsets(200 records each time) and create a thread that'll construct the POJOs and keep them in a hashtable. While the cache is being loaded(when I start the application) the User will see a wait sign. For storing the data in HashTable is an issue I'll actually store the processed data in to another DB table(marshall the POJO to xml). 
   I use a third party API to load the data from database. Once I load a record I'll have load the data I'll have to load associations for the loaded data and then associations for the association found at the top level. It's like loading a family tree.</p>
  
  <ol>
  <li>I can't use Hibernate or any ORM framework as I'm using a third party API to load the data which is shipped with the database it self(it's a product). More over I don't think loading data once is not a big issue.</li>
  <li>If there is a possibility to fine tune the business logic I wouldn't have asked this question here.</li>
  </ol>
  
  <p>Caching the data on demand is an option, but I'm trying to see if I can do anything better.</p>
  
  <p>Suggest me if there is a better idea that you are aware of. Thank you./</p>