anything
AirNav RadarBox
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
 


Author Topic: Editing the database while program running  (Read 2507 times)

0 Members and 1 Guest are viewing this topic.

Jay911

  • New Member
  • *
  • Posts: 35
Editing the database while program running
« 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!
--j.

bearcat

  • Full Member
  • ***
  • Posts: 197
Re: Editing the database while program running
« Reply #1 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.

DaveReid

  • Hero Member
  • *****
  • Posts: 1815
    • Heathrow last 100 ADS-B arrivals
Re: Editing the database while program running
« Reply #2 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
This post has been scanned for any traces of negativity, bias, sarcasm and general anti-social behaviour