Re: FlushDatabase Suggestion

This WebDNA talk-list message is from

1998


It keeps the original formatting.
numero = 18043
interpreted = N
texte = I think you would need to have. new tag - [lock db=yourdb.db] locks a database keeping it from being read/written to/from disk until machine is restarted or until it recieves a [load db] command. Closedatabase nor flushdatase commands could not override this setting.[copyfile path=new/yourdb.db&to=yourdb.db]newtag [load db=yourdb.db]Barring this it would be very difficult for someone to beat your copyfile command, if you wanted to be sure your could do the following. With this scheme you backup your file before you remove and replace it. Then you close the database removing it from ram. After which you delete the file, preventing anyone from reloading it. It would be tough to beat the time between the closedatabase command and the deletefile command. This scenario would best meet the strictest available conditions, however if you crashed at the deletefile and before the copyfile you would not have access to the yourdb.db file and would have to retrieve it from the backup folder in order to get it going again. This is somewhat retentive but it does take into account all of your possible concerns.[copyfile path=yourdb.db&to=backup/archive.db](just for protection) [closedatabase path/to/some.db] [deletefile path=yourdb.db] [copyfile path=path/to/some.db&to=../somefolder/archive.db]Pat McCormick wrote:> Kenneth Grome wrote: > > > [closedatabase path/to/some.db] > > [copyfile path=path/to/some.db&to=../somefolder/archive.db] > > > > And yes, the [copyfile] tag *does* create the archive file if it didn't exist -- but the [closedatabase] tag does not, and that's why these two tags must be used together in order to achieve the results you asked for ... :) > > Ken, > > I have two folders: new & current, each containing a respective copy of a > catalog database. I want an URL which will dump the current, RAM database, > load the new one from the new directory, then save it to the current > directory, and make all subesequent accesses to the currect db. > > Will you solution achieve this - even if hits arrive during the close and copy process? > > -Pat Associated Messages, from the most recent to the oldest:

    
  1. Re: FlushDatabase Suggestion (Pat McCormick 1998)
  2. Re: FlushDatabase Suggestion (Pat McCormick 1998)
  3. Re: FlushDatabase Suggestion (Pat McCormick 1998)
  4. Re: FlushDatabase Suggestion (Kenneth Grome 1998)
  5. Re: FlushDatabase Suggestion (bob 1998)
  6. Re: FlushDatabase Suggestion (bob 1998)
  7. Re: FlushDatabase Suggestion (bob 1998)
  8. Re: FlushDatabase Suggestion (Pat McCormick 1998)
  9. Re: FlushDatabase Suggestion (Pat McCormick 1998)
  10. Re: FlushDatabase Suggestion (Kenneth Grome 1998)
  11. Re: FlushDatabase Suggestion (Bob Minor 1998)
  12. Re: FlushDatabase Suggestion (Pat McCormick 1998)
  13. Re: FlushDatabase Suggestion (Bob Minor 1998)
  14. Re: FlushDatabase Suggestion (Pat McCormick 1998)
  15. Re: FlushDatabase Suggestion (Kenneth Grome 1998)
  16. Re: FlushDatabase Suggestion (Pat McCormick 1998)
  17. Re: FlushDatabase Suggestion (Kenneth Grome 1998)
  18. FlushDatabase Suggestion (Pat McCormick 1998)
I think you would need to have. new tag - [lock db=yourdb.db] locks a database keeping it from being read/written to/from disk until machine is restarted or until it recieves a [load db] command. Closedatabase nor flushdatase commands could not override this setting.[copyfile path=new/yourdb.db&to=yourdb.db]newtag [load db=yourdb.db]Barring this it would be very difficult for someone to beat your copyfile command, if you wanted to be sure your could do the following. With this scheme you backup your file before you remove and replace it. Then you close the database removing it from ram. After which you delete the file, preventing anyone from reloading it. It would be tough to beat the time between the closedatabase command and the deletefile command. This scenario would best meet the strictest available conditions, however if you crashed at the deletefile and before the copyfile you would not have access to the yourdb.db file and would have to retrieve it from the backup folder in order to get it going again. This is somewhat retentive but it does take into account all of your possible concerns.[copyfile path=yourdb.db&to=backup/archive.db](just for protection) [closedatabase path/to/some.db] [deletefile path=yourdb.db] [copyfile path=path/to/some.db&to=../somefolder/archive.db]Pat McCormick wrote:> Kenneth Grome wrote: > > > [closedatabase path/to/some.db] > > [copyfile path=path/to/some.db&to=../somefolder/archive.db] > > > > And yes, the [copyfile] tag *does* create the archive file if it didn't exist -- but the [closedatabase] tag does not, and that's why these two tags must be used together in order to achieve the results you asked for ... :) > > Ken, > > I have two folders: new & current, each containing a respective copy of a > catalog database. I want an URL which will dump the current, RAM database, > load the new one from the new directory, then save it to the current > directory, and make all subesequent accesses to the currect db. > > Will you solution achieve this - even if hits arrive during the close and copy process? > > -Pat Bob Minor

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:

[addlineitems] (1997) Sticky .inc file! (2008) problems with 2 tags (1997) NT Manual (1997) [WebDNA] How to stop cutting a word (2008) Login and pass variables to [protect] tag (2001) [WebDNA] Emailer Issue (2009) date formatting question (2001) Multiple prices (1997) Protect and Serve (1999) emailer on Windows Beta 18 (1997) this works sometimes and sometimes not (1997) OT-JS why it does not run on Mac (2001) Server crashes when user saves or views html source (1998) WebCatalog Technical Reference (1997) Emailer setup (1997) Protect and Serve (1999) WebCat2b15MacPlugin - [protect] (1997) PCS Frames (1997) ConvertChars? (1998)