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 Grome 808-737-6499 WebDNA Solutions mailto:ken@webdna.net http://www.webdna.net Associated Messages, from the most recent to the oldest:

    
  1. Re: Updating a database once per day - An example ( 1998)
  2. Re: Updating a database once per day - An example (bob 1998)
  3. Re: Updating a database once per day - An example (Kenneth Grome 1998)
  4. Re: Updating a database once per day - An example (Steve Rosenbaum 1998)
  5. Re: Updating a database once per day - An example (Kenneth Grome 1998)
  6. Re: Updating a database once per day - An example (Marty Schmid 1998)
  7. Re: Updating a database once per day - An example (Kenneth Grome 1998)
  8. Re: Updating a database once per day - An example (Kenneth Grome 1998)
  9. Re: Updating a database once per day - An example (Gary Richter 1998)
  10. Re: Updating a database once per day - An example (Peter Ostry 1998)
  11. Re: Updating a database once per day - An example (Kenneth Grome 1998)
  12. Re: Updating a database once per day - An example (Kenneth Grome 1998)
  13. Re: Updating a database once per day - An example (Rob Marquardt 1998)
  14. Re: Updating a database once per day - An example (Peter Ostry 1998)
  15. Re: Updating a database once per day - An example (Kenneth Grome 1998)
  16. Re: Updating a database once per day - An example (Kenneth Grome 1998)
  17. Re: Updating a database once per day - An example (Rob Marquardt 1998)
  18. Re: Updating a database once per day - An example (Rob Marquardt 1998)
  19. Re: Updating a database once per day - An example (Kenneth Grome 1998)
  20. Re: Updating a database once per day - An example (Steve Rosenbaum 1998)
  21. Re: Updating a database once per day - An example (Kenneth Grome 1998)
  22. Updating a database once per day - An example (Steve Rosenbaum 1998)
>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 Grome 808-737-6499 WebDNA Solutions mailto:ken@webdna.net http://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:

[MIDDLE %22] Broken (2003) ListFields and [name] (1997) Bug Report, maybe (1997) Calendar using WebCatalog? (1997) Quick ShowIf question (1997) [WebDNA] sendmail html with images attached (2008) Max Record length restated as maybe bug (1997) Webcatalog-firesite and [referrer] tag (1997) Multiple fields on 1 input (1997) Cookie and Domain Names (2005) Me know logical no need (2002) Ampersand Character (&) (1997) WebCat2 - [format thousands] (1997) Changing price for a SLU based on options (size, etc.) (1997) Email header munger in [sendmail] (2004) special commerce fields (1997) HTML Editors (1997) PSC recommends what date format yr 2000??? (1997) Targeted Redirect (1999) SQL Ref. (1999)