Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

DBAccess interface

 
sean mc cusker
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,
I have a question about the DBAccess interface,
My intentions are to create a simple database (basically a hashmap in memory) at the server which shall hold the information from the .db file, with one instance of this per client. I want to read information from this database to the GUI and persist all changes made to these databases to the db file.

My problem is that looking at the file I am not sure I can do this. For Example:

"//Reads a record from the file.
//Returns an array where each element is a record value

public String [] readRecord(long recNo) throws RecordNotFoundException;


Looking at the comments I believe that I must use this to access the .db file directly, and that im not allowed to use a database in memory.

Am i interpreting this incorrectly and if so what do you think my options are?
 
Diego Amicabile
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I had similar requirements in my assignment, but I did implement a cache in my data store class. I made sure I did not have stale data in my cache (writing data to the file AND the cache).
It turned out to be OK, I got 40/40 in the data store part.
 
David Abramowicz
Ranch Hand
Posts: 56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi!

I believe you will have something like "only one application will have access to the data file at a time" in your instructions.html. I found this to be rather contrary to the "you may not change the data schema as other applications utilise the data file", however I guess these applications only have read-access.... An interesting thought is also that if other applications have write access to the data file, it completely invalidates the locking

Anywho.... Since you have exclusive write access to the data file, as long as you update your data cache when you perform writes, you can be sure that the cache sports accurate data.
 
sean mc cusker
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Some v valid points there. Thanks for you help, im more sure now about my solution.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic