I am on Window 7, opening an existing database with these flags:

SQLITE_OPEN_EXCLUSIVE |
SQLITE_OPEN_READWRITE |
SQLITE_OPEN_CREATE

Then I get a value from one table, begin a transaction, create a temp
customer table, fill it with the current values from the customer table.
Here is that SQL run by calling sqlite3_exec():

SELECT ItemValue FROM DBLookup WHERE Category = 'SystemSettings' AND
ItemName = 'Version';

BEGIN TRANSACTION;

CREATE TABLE CustomerTemp ( CustomerId INTEGER NOT NULL, CustomerDetailId
INTEGER, IsInSlideShow INTEGER NOT NULL, Username VARCHAR(50) NOT NULL,
Password VARCHAR(50), IsDeleted INTEGER NOT NULL DE
FAULT 0, CopiedTo INTEGER, insertedby VARCHAR(50) NOT NULL, instertedon
TIMESTAMP NOT NULL, updatedby VARCHAR(50) NOT NULL, updatedon TIMESTAMP NOT
NULL, PRIMARY KEY (CustomerId), UNIQUE (username));

INSERT INTO CustomerTemp (CustomerId, IsInSlideShow, Username, Password,
insertedby, instertedon, updatedby, updatedon)
       SELECT CustomerId, IsInSlideShow, Username, Password, insertedby,
instertedon, updatedby, updatedon FROM Customer ORDER BY CustomerId;

This all works fine.  Then I go to drop the current customer table and I
always get a "database table is locked":

 DROP TABLE Customer;

I tried committing the transaction before the drop and that doesn't have any
impact.  I also have foreign keys turned off, I tried turning them off but
that also has no impact.  Low and behold, when I go into SQLite Manager (the
Firebird plugin), I am able to drop the table without any problems.

Any thoughts on the table is locked and how to unlock it?  I know for a fact
no other process has it open.

Sam
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to