Re: Updating a database once per day - An example
This WebDNA talk-list message is from 1998
It keeps the original formatting.
numero = 17975
interpreted = N
texte = >On 5/31/1998 11:29 pm, Kenneth Grome so noted...>>>If you want to make sure this manual updating process works properly>>without any problems, other than *possibly* a visitor or two getting an>>Error: the database 'test.db' could not be found or opened message>>during the process (which should take no more than a second or two at the>>most), do this in your update template:>>>>[DELETEFILE] <--trash the current db file>>[CLOSEDATABASE] <--purge the RAM cache>>[MOVEFILE] <--move the new db file into place>>>>This insures that when it's time to move the new db file into position,>>the old data is already purged from RAM ... and the old db file could not>>be reloaded because it wasn't there to be reloaded -- it was already>>deleted from disk.>It's my understanding that [closedatabase] writes out any modifications>to disk before closing ...Yes, this is correct.>will it create a new file if the expected>database file is missing? Probably a moot point, since I currently have>autocommit turned on, but if I didn't?No, it will not. I just tested it to be absolutely sure, and it does NOT recreate the test.db file that's missing ...>Getting the database not found error for those few seconds would>probably be acceptable (albeit kludgy).It's not even a few seconds, so I don't think you have anything to be concerned about. I just tested this to see exactly how long it atakes for the 3 tasks above to be performed. In repeated tests on my very old, slow 68040 Mac it still takes 7 ticks, which is 7/60 of a second. That's barely more than a tenth of a second! I doubt your visitors have much of a chance of hitting the missing db precisely during those 7 ticks ... but anything's possible I suppose.>Is there way to tell the ErrorMessages.db to point to a custom>error page of my own designUse [include] in the message field instead of what's there ...>can there be multiple ErrorMessages.db files to handle>customization on a site by site basis?No, but you can probably simulate the same thing with showif's and hideif's in your [include] file.>I know that this thread comes 'round every couple months or so. It would>be good to have some definitive word on the (apparently common) subject>from PCS, or some additional tags/tools with WebCatalog to make the>process easier.It couldn't get much easier than it is, this is all I put in my template to update my test db file and it works exactly as I expected it to work:[deletefile test.db][closedatabase test.db][movefile path=spareFolder/test.db&to=test.db]Nevertheless, confirmation from PCS is more than welcome ... :)Sincerely,Ken Grome808-737-6499WebDNA Solutionsmailto:ken@webdna.nethttp://www.webdna.net
Associated Messages, from the most recent to the oldest:
>On 5/31/1998 11:29 pm, Kenneth Grome so noted...>>>If you want to make sure this manual updating process works properly>>without any problems, other than *possibly* a visitor or two getting an>>Error: the database 'test.db' could not be found or opened message>>during the process (which should take no more than a second or two at the>>most), do this in your update template:>>>>
[deletefile] <--trash the current db file>>
[closedatabase] <--purge the RAM cache>>
[movefile] <--move the new db file into place>>>>This insures that when it's time to move the new db file into position,>>the old data is already purged from RAM ... and the old db file could not>>be reloaded because it wasn't there to be reloaded -- it was already>>deleted from disk.>It's my understanding that
[closedatabase] writes out any modifications>to disk before closing ...Yes, this is correct.>will it create a new file if the expected>database file is missing? Probably a moot point, since I currently have>autocommit turned on, but if I didn't?No, it will not. I just tested it to be absolutely sure, and it does NOT recreate the test.db file that's missing ...>Getting the database not found error for those few seconds would>probably be acceptable (albeit kludgy).It's not even a few seconds, so I don't think you have anything to be concerned about. I just tested this to see exactly how long it atakes for the 3 tasks above to be performed. In repeated tests on my very old, slow 68040 Mac it still takes 7 ticks, which is 7/60 of a second. That's barely more than a tenth of a second! I doubt your visitors have much of a chance of hitting the missing db precisely during those 7 ticks ... but anything's possible I suppose.>Is there way to tell the ErrorMessages.db to point to a custom>error page of my own designUse
[include] in the message field instead of what's there ...>can there be multiple ErrorMessages.db files to handle>customization on a site by site basis?No, but you can probably simulate the same thing with showif's and hideif's in your
[include] file.>I know that this thread comes 'round every couple months or so. It would>be good to have some definitive word on the (apparently common) subject>from PCS, or some additional tags/tools with WebCatalog to make the>process easier.It couldn't get much easier than it is, this is all I put in my template to update my test db file and it works exactly as I expected it to work:[deletefile test.db][closedatabase test.db][movefile path=spareFolder/test.db&to=test.db]Nevertheless, confirmation from PCS is more than welcome ... :)Sincerely,Ken Grome808-737-6499WebDNA Solutionsmailto:ken@webdna.nethttp://www.webdna.net
Kenneth Grome
DOWNLOAD WEBDNA NOW!
Top Articles:
Talk List
The WebDNA community talk-list is the best place to get some help: several hundred extremely proficient programmers with an excellent knowledge of WebDNA and an excellent spirit will deliver all the tips and tricks you can imagine...
Related Readings:
cr/cr/lf under WebSite ($WebCat.exe) confirmed (2000)
OT - Extract frames from GIF (2004)
hideif [x]=1,2,3.. (2003)
Single Link browsing (1997)
PR: WebCatalog Affiliates Program Announced -- Share the revenue for promoting WebCatalog (2000)
[WriteFile] problems (1997)
[OT] Bad Cookie / Internet Option / Internet Explorer (2004)
[searchString] (1997)
Emailer file formats (1998)
Exclamation point (1997)
WebDNA Verison 4.5 will Not Restart! This SUCKS! (2002)
Re:2nd WebCatalog2 Feature Request (1996)
FW: 2.01 upgrade problems (1997)
forming a SKU (1999)
Password problems with WebCat 4.01 (2000)
[WriteFile] problems (1997)
OT: Need (a tiny bit) of help setting up MySQL (2000)
Snake Bites (1997)
Cookies Question (2000)
Textarea Breaks (2000)