• 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 - help

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 532
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic