Windows Develop Bookmark and Share   
 index > Windows Forms Sample Applications > Terrarium Server won't reintroduce
 

Terrarium Server won't reintroduce

Hi, I've set up a Terrarium server sucessfully (I thought) and I connected with a client and introducted a couple of creatures.  Everything worked great.  I shut down both systems for a couple of weeks.  When I started the systems back up it was fine for a minute, but then all my bugs died of old age and I recieved a message box saying that they died because it had been too long since I was connected (or something like that)

Now the server doesn't seem to work.  I can connect to the Terrarium server ok but I can't get any creatures.  I've tried to reintroduce the creatures, but I don't get anything on the server list.  Yet when I look at the web page and the database, they are there.  Is this a defect? (hard to say "bug" on this forum)

Also,  Is there a script that will reset the database, and web server to a blank state?
TerrariumNewbie  Wednesday, November 09, 2005 3:03 PM
OK, so it took till the weekend for me to get around to this.  Here's the SQL statement that cleans up the data...

// Make species that haven't been reported in 48 hours extinct.
update species
     set Extinct = 1, 
          ExtinctDate = getutcdate()

 where Extinct = 0
   
and Name not in (select SpeciesName
                              from DailyPopulation
                            where SampleDateTime > DATEADD(dd, -2, getutcdate())
                           )

// Remove extinct species from the History table.
delete from History
       where SpeciesName in
(select Name
                                         from Species 
                                       where Extinct = 1)

You could fix the problem by modifying the stored procedure that marks extinct animals (sorry but I don't remember it's name off of the top of my head), but I discovered that after I had already implemented this solution, and that stored procedure is rather complicated, and I'm too lazy to change it since my solution works OK.

I actually use a -14 instead of -2 since I modified the Server to allow a client to be offline for up to two weeks before killing off it's population.  When you only have a few clients 48 hours just isn't enough.  But, that's another thread...

David Kocur  Saturday, November 19, 2005 5:58 PM
Yes.  This is a "defect" in the Terrarium Server.  I have a utility app that I run every night to correct the situation.  I'll post the SQL when I get home tonight.
dkocur2  Wednesday, November 16, 2005 9:48 PM
OK, so it took till the weekend for me to get around to this.  Here's the SQL statement that cleans up the data...

// Make species that haven't been reported in 48 hours extinct.
update species
     set Extinct = 1, 
          ExtinctDate = getutcdate()

 where Extinct = 0
   
and Name not in (select SpeciesName
                              from DailyPopulation
                            where SampleDateTime > DATEADD(dd, -2, getutcdate())
                           )

// Remove extinct species from the History table.
delete from History
       where SpeciesName in
(select Name
                                         from Species 
                                       where Extinct = 1)

You could fix the problem by modifying the stored procedure that marks extinct animals (sorry but I don't remember it's name off of the top of my head), but I discovered that after I had already implemented this solution, and that stored procedure is rather complicated, and I'm too lazy to change it since my solution works OK.

I actually use a -14 instead of -2 since I modified the Server to allow a client to be offline for up to two weeks before killing off it's population.  When you only have a few clients 48 hours just isn't enough.  But, that's another thread...

David Kocur  Saturday, November 19, 2005 5:58 PM
Hello David, it has been a long time, have u tried terrarium 2.0? im testing at mi Vista laptop.

regards.

Pepepaco  Sunday, August 24, 2008 2:39 PM

You can use google to search for other answers

Custom Search

More Threads

• Adding field to add task
• What is the data member when using a stored procedure?
• three tier archetecture
• A working Terrarium with v1.1 framework?
• Seeking a simple program ~ text to binary converter
• Server Not Responding Work Around
• Terrarium still active?
• always can't connect Terrarium server
• Permission Denied :'getObject'
• Discussion Board