AirNav Systems Forum

AirNav Radar => AirNav Radar Discussion => Topic started by: Jay911 on February 17, 2010, 11:28:56 PM

Title: Editing the database while program running
Post by: Jay911 on February 17, 2010, 11:28:56 PM
Hi all,

I want to do some serious cleanup of the database on my installation. I don't want to use a wiped-out blank database, and I don't want to use Database Explorer because I'm not very fond of its user interface. So I want to edit the database externally, either by editing the file that's in use by the program while it's running, or a second copy which I'll then copy back in to the program's data directory. Can this be done while the program is running?

Thanks in advance!
Title: Re: Editing the database while program running
Post by: bearcat on February 18, 2010, 12:55:38 PM
I prefer to do it on a copy and then replace the original when ANRB is closed down. BUT I keep the original so I have a good version if any thing goes wrong.
Title: Re: Editing the database while program running
Post by: DaveReid on February 18, 2010, 02:10:43 PM
From The Definitive Guide to SQLite:

SQLite has coarse-grained locking, which allows multiple readers but only one writer at a time.  Writers exclusively lock the database during writes and no one else has access during that time.  SQLite does take steps to minimize the amount of time in which exclusive locks are held.  Generally, locks in SQLite are kept for only a few milliseconds.  But as a general rule of thumb, if your application has high write concurrency (many connections competing to write to the same database) and it is time critical, you probably need another database.  It is really a matter of testing your application to know what kind of performance you can get.

HTH
Dave