aspose file tools*
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes B&S v2.3.1 - Data, CacheManager and RecordNotFoundException  Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "B&S v2.3.1 - Data, CacheManager and RecordNotFoundException  " Watch "B&S v2.3.1 - Data, CacheManager and RecordNotFoundException  " New topic
Author

B&S v2.3.1 - Data, CacheManager and RecordNotFoundException

Arun Subramanian
Ranch Hand

Joined: Oct 30, 2002
Posts: 47
Howdy all -
After a very long hiatus, I have started working on my assignment once more. Please comment on my BS design and code reached thus far on Data, CacheManager and RecordNotFoundException. I would really like to hear if any others have similar approaches for preloading cache etc. To give context to some of the code snippets below, a brief description of some relevant components is in order:
  • Each client gets its own Data object.
  • There's a LockManager singleton and a CacheManager singleton in the JVM.
  • The CacheManager's collection object (map) will be preloaded by the first data instance that gets to it. CacheManager's cache collection caches all the records available in the db file.
  • Data's read method reads "only" from the cache while update, delete and create methods update the cache.
  • RecordNotFoundException is thrown when a record doesn't exist in the cache or is a deleted record.
  • The readRecordFromCache method is synchronized while isRecordInCache is not.
  • The Record class encapsulates the data in the record and whether it's an active record.



  • Thank you for your time.

    Thanks,
    Arun.

    [ March 23, 2006: Message edited by: Arun Subramanian ]
    [ March 24, 2006: Message edited by: Arun Subramanian ]

    SCJP 1.4, SCBCD 1.3, SCWCD 5.0, SCJD B&S 2.3.1 (in progress)
    R Joshi
    Greenhorn

    Joined: Feb 21, 2006
    Posts: 13
    Caching is fine but you may need to persist the data in filesystem at regular intervals(?)
    Note:According to the specs 'the data must continue to be manipulated for reports using another custom-written application'


    B&S(2.3.1)<br />There are no stupid questions. Answers maybe
    Arun Subramanian
    Ranch Hand

    Joined: Oct 30, 2002
    Posts: 47

    Caching is fine but you may need to persist the data in filesystem at regular intervals(?)
    Note:According to the specs 'the data must continue to be manipulated for reports using another custom-written application

    My bad in probably not explaining it well. I try to keep the file and the cache in sync. I should have said:
  • Data's read method reads "only" from the cache while update, delete and create methods update the file and then update the cache. In other words, of the CRUD operations, R is a cache only operation while C, U and D first modify the file and then sync the cache.


  • Thanks.
     
    I agree. Here's the link: http://aspose.com/file-tools
     
    subject: B&S v2.3.1 - Data, CacheManager and RecordNotFoundException