[sqlite] Under what circumstances can a table be locked when the database is first opened?

2015-05-23 Thread da...@andl.org
Locking mode: Is this documented anywhere? As I thought I said, it's a standalone program; run it to normal termination; then run it again. Single connection, no flags enabled at open (just the default). Yes, I've been using Process Explorer for at least 10 years, since it was at sysinternals.

[sqlite] Under what circumstances can a table be locked when the database is first opened?

2015-05-23 Thread da...@andl.org
Thanks for the summary. Could be a useful addition to the docs. 1) single user. 2) I'm not 'using' anything. Just default open. 3) --> this could be it. How does this work exactly, and how do you avoid it/correct it (after the event)? 4) N/A 5) Latest download. 6) Windows 8.1 NTFS. 7) None. 8)

[sqlite] Under what circumstances can a table be locked when the database is first opened?

2015-05-23 Thread Barry Smith
Hi, Unless you are using shared cache, SQLite does not lock on a per table level - only it locks the entire database. Under what circumstances are you trying to access the database both times? Are these multiple connections within the same process or are you shutting down the process and then

[sqlite] Under what circumstances can a table be locked when the database is first opened?

2015-05-23 Thread da...@andl.org
Question: Under what circumstances can a table be locked when the database is first opened? My program does: DROP TABLE IF EXISTS CREATE TABLE INSERT INTO (multiple times) SELECT * (for each row) Run it once and it works perfectly. Run it twice and the DROP TABLE triggers the error:

[sqlite] Under what circumstances can a table be locked when the database is first opened?

2015-05-23 Thread Simon Slavin
On 23 May 2015, at 4:13am, david at andl.org wrote: > Run it once and it works perfectly. Run it twice and the DROP TABLE triggers > the error: > > SQLITE_LOCKED, database table is locked I suspect Keith has it right. To help you figure out which of his options is right, Run it once. Stay

[sqlite] Under what circumstances can a table be locked when the database is first opened?

2015-05-22 Thread Keith Medcalf
1) Something else has the database open and locked. 2) You are using Shared Cache 3) Something forgot to finalize a select 4) The database is stored on a non-locally-attached filesystem 5) An issue in the version of SQLite you are using (and you did not say which version you are using) 6)