Author Topic: writing to database  (Read 1550 times)

jodybingo

  • Hero Member
  • *****
  • Posts: 667
    • View Profile
    • Personal Web Site
writing to database
« on: June 19, 2011, 03:08:04 PM »
Hi Corey.
I use as many as 3 computers at work to run TD and all use the same data store (one desktop as the host of the data store and 2 laptops that connect to it. The desktop is always the first machine to load the data store. If one of the laptops create a new player it never seems to appear in the DB and therefore the next time I load TD from any machine, that player is not in the database. Do I have to send any new players to the station where the data store is hosted?

Corey Cooper

  • Administrator
  • Hero Member
  • *****
  • Posts: 6216
    • View Profile
Re: writing to database
« Reply #1 on: June 20, 2011, 05:56:43 PM »
The TD is not designed to work in this way.  The software loads the database when it starts and retains it in memory, and rewrites it as necessary.  So in your scenario, each instance of the software will be working with its own copy of the database, and changes to one will not be seen by the others.  This also means the last one wins, which basically means the last instance to write the database will be the one that is ultimately saved, as it will overwrite any changes made by the other instances.

jodybingo

  • Hero Member
  • *****
  • Posts: 667
    • View Profile
    • Personal Web Site
Re: writing to database
« Reply #2 on: June 20, 2011, 06:06:00 PM »
This would then explain an earlier post of players 'disappearing' from my database and players not being deleted...