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

database - help

 
kevin mc cusker
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Im a little confused about the database part.
I have read the data from the file using raf. Do i save this to a vector and then just use this vector for all my operations, ignoring the db file from there on, or do i need to update the actual db file via the vector ie GUI<->vector<->bd file. Any suggestions on how to implement this would be welcome. Thanks.
 
Hanna Habashy
Ranch Hand
Posts: 532
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi Kevin:
You can do it either way, it depends on you data access design. If you choose to cach the database record in memory, i.e. using collections, you cannot ignore the database file. You need to update the database accordingly. So you have to make sure that what you have in memory cach is what you have in the file, this is called data integrity.
[ June 06, 2004: Message edited by: Hanna Habashy ]
 
kevin mc cusker
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
cheers hannah,
when two clients load the data to a collection, one updates the db file, then the other client has out of date information.
Should i have the collection on the server, with everyone using that to search etc? Also, is it ok to have each record as one large string or should i divide the record into for example, name, address etc?
 
Hanna Habashy
Ranch Hand
Posts: 532
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Kevin:
These are design choices that you have to make, and then explain in your written exam. All these options are valid options, it is up to you to choose one. I will tell you what I did myself, but this is just my choice.
I don't cach the data, instead I access the database file every time data is required. I keep a static collection to control the lock mechanism.
I read about many diffrent interesting designs in this forum, and all of them are valid ones.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic