Meaningless Drivel is fun!*
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes (B&S) Ideas on Updating Cache Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "(B&S) Ideas on Updating Cache" Watch "(B&S) Ideas on Updating Cache" New topic
Author

(B&S) Ideas on Updating Cache

Saheed Adepoju
Ranch Hand

Joined: Jun 23, 2004
Posts: 267
Hi all
I have been wondering for a while how easy it would be to update the cache once an update has been done. I was tempted to send the data to be updated to a method that would retrive the recNo and then search for the record and update the object accordingly. My assumption is based on the following code:


However, i quickly notice, i have to hardcode the setters. I dont know if anyone id feeling me on this. I wouldnt mind an insight on how to accomplish this. Thanks all.


Saheed Adepoju<br />SCJP 1.4<br />SCJD (B&S..In progress)
Aruneesh Salhotra
Ranch Hand

Joined: May 12, 2004
Posts: 167
Good that I finally see code pieces which look on the similar lines I am working on.

One thing, I think the cache is a misnomer, just that the vector array (in my case), is a in memory replica of the file, which gets written to the disk once the object is modified.
Andrew Monkhouse
author and jackaroo
Marshal Commander

Joined: Mar 28, 2003
Posts: 11404
    
  81

Hi Saheed,

Just a little hint: Why does your cache need to know what is in the String[] it is storing?

Regards, Andrew


The Sun Certified Java Developer Exam with J2SE 5: paper version from Amazon, PDF from Apress, Online reference: Books 24x7 Personal blog
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: (B&S) Ideas on Updating Cache
 
Similar Threads
(B&S)Doubt about my read() concept
B&S: findByCriteria - pls review
(B&S)Question regarding locking()&unlock()
B&S: updateRecord & thread-safe design
B&S: Opening database