• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

database with URLyBird

 
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
There is an interface Sun wants implemented. It has a series of methods with their signatures. Many of these methods read and write directly to the database.

readRec(long recordNumber) is supposed to read a file out of the database. Is this not a waste of time? Shouldn't the server, upon starting, read the whole database into memory? All clients that access the database access the one in memory. Any modifications are done by the server to the database, if successful, then to the database in memory?


Robert
 
author and jackaroo
Posts: 12200
280
Mac IntelliJ IDE Firefox Browser Oracle C++ Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Robert,

It sounds like you are proposing a cache for the data - something that many candidates implement, and it certainly doesnt seem to cause loss of marks.

It has been suggested (from memory by Max Habibi) that a cache could be implied in the instructions - the fact that the read method (amongst others) does not throw InterruptedException would work well with in a cached environment (you can have your constructor populate the cache, and the constructor can throw any Exception you like). That still leaves the problem of the update method but nobody said that everything was going to be easy .

However when implementing a cache you need to consider how many records you can hold in memory / what happens if you run out of memory (this is easily answered, but I am leaving that to you).

Whatever you decide, you need to document your design decisions.

Regards, Andrew
 
Author
Posts: 144
5
jQuery Eclipse IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Currently I am working on the B&S Assignment. I currently read all my Contractors in the constructor. I noticed in the Exam Cram book they have a getData method and Max's book has a getDvds(). What are the pros and cons of doing it separately? I guess I thought that since I didn't have a getData method in my interface that I should read all data in in the constructor. That was probably a bad assumption.
Thanks,
Tom
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic