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:

Triggers & New Version? (1999) Resume Catalog ? (1997) Location of Browser Info.txt file (1997) [OT] - Messed up me user permissions - help ! (2004) Archive Problem (2000) Multiple searches on a single page / random record from full database? (1999) Updating Integer value in DB (2007) WebTen? (1997) Highlighting words found in a keyword search (2003) Perl to WebDNA help please (2008) Nested tags count question (1997) File Upload (1997) Re:[ShowIf] and empty fields (1997) [WebDNA] INCLUDE file= in the footer (2009) WebCatalog can't find database (1997) Multiple catalog databases and showcart (1997) is sku a REQUIRED field on NT (1997) Re:2nd WebCatalog2 Feature Request (1996) Add to cart issue (2007) Smith Micro SUPPORT? (2000)