trend Posted March 21, 2005 Posted March 21, 2005 I am wondering what you'll think the best option for this scenaro: I have some software that needs access to the internet to send error reports and some other random stuff. This software accesses a db (right now an access db) to get pricing info and availability (availability is updated upon item purchased) and the db does some other random stuff. I really want this software to be able to use the internet connection to access an xml file on a websierver.. or an mysql server or ms sql server.. but my only problem is I am scared the internet might go down.. and if this happens, and no one can pull up pricing info and availability and there will be some pisses off people. So I was just wondering what you'll do for something like this.. Do you'll cache the db once a day or something just incase something like this happens? or what. I would just do something as simple as this: If internet_connection = true then use db at database.server.com elseif internet_connection = false then use db at C:\ end if But, then all things would get out of sync if the internet connection goes down.. this is because I need to read and write to a db... so I would then need to be able to resync the db.. which this sounds way over my head (not sure if it is or not :/) any ideas? thanks! Lee Quote
trend Posted March 23, 2005 Author Posted March 23, 2005 Would this just be ADO.NET in disconnect mode? Or is there a better option? Quote
cpopham Posted March 23, 2005 Posted March 23, 2005 Do the users have a local server? If so, you could put a copy of the database there and use date/time stamps. Have a timer setup that wouldfire every so often to check if the Internet is available. If it available, use the date time stamps to update the newest information to the web database and update the pricelist. This would keep you from having multiple databases one on every users computer. Chester Quote ____________________________________________ http://www.pophamcafe.com I am starting a developers section, more tutorials than anything.
trend Posted March 24, 2005 Author Posted March 24, 2005 well each client computer wouldn't have a lan to connect them. (they are going to be 50miles or more appart). I was thinking about having a client side and server side sql server.. but I really don't want to have 2 db servers.. I was hoping there was some way of caching whole tables ina db server in vb.net so that if the client computer doesn't have access to the internet at the moment.. it still can query and get the info.. And the client computer could also update the cached db.. Also if the internet is ever discovered down.. there would be a timer that would fire every 5 minutes or whenever to try to connect to the db.. and if internet=true, update db with cached db info thanks for the idea though :) Quote
michael_hk Posted March 24, 2005 Posted March 24, 2005 Save your dataset on the client side as XML file. Use DataSet.WriteXml() Quote There is no spoon. <<The Matrix>>
trend Posted March 25, 2005 Author Posted March 25, 2005 Interesting.. do you think this is better than using ado.net in disconnect mode? Quote
cpopham Posted March 25, 2005 Posted March 25, 2005 If you have a disconnected dataset in stored in memory, you can syncronize with the main db ever so often. However, what happens if you have a computer crash or power interruption? Whatever was in the dataset on that PC is now gone. So where will that leave your user if they have not syncronized in say 15-30 minutes and they for example had a huge order they took care of. That order is now gone. Dues to the fact that .net uses XML primarily when dealing with dbs, michael_hk's suggesting is actually a very good idea for when you can not sync up with the main db pver the internet. It is fast and efficient and if the pc crashes or anything, the file is right there on the pc so they can pick up right where they left off. :) Chester Quote ____________________________________________ http://www.pophamcafe.com I am starting a developers section, more tutorials than anything.
trend Posted March 25, 2005 Author Posted March 25, 2005 If you have a disconnected dataset in stored in memory, you can syncronize with the main db ever so often. However, what happens if you have a computer crash or power interruption? Whatever was in the dataset on that PC is now gone. So where will that leave your user if they have not syncronized in say 15-30 minutes and they for example had a huge order they took care of. That order is now gone. Dues to the fact that .net uses XML primarily when dealing with dbs, michael_hk's suggesting is actually a very good idea for when you can not sync up with the main db pver the internet. It is fast and efficient and if the pc crashes or anything, the file is right there on the pc so they can pick up right where they left off. :) Chester Ahh I see now.. How hard it is syncronizing a xml file with a db? Quote
michael_hk Posted March 26, 2005 Posted March 26, 2005 Ahh I see now.. How hard it is syncronizing a xml file with a db? The simpliest way is to create a brand new XML instead of synchronizing it with the db. Quote There is no spoon. <<The Matrix>>
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.