On Mon, Jul 12, 2010 at 09:47:24AM -0400, Sam Carleton scratched on the wall:

> 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():

> 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.

  Are you using sqlite3_exec() for all of these?  My first guess is that
  you're not finalizing the INSERT statement (or allowing it to run to
  completion) before trying to drop the table.

  You can't drop a table if there are any in-progress statements.

   -j


-- 
Jay A. Kreibich < J A Y  @  K R E I B I.C H >

"Intelligence is like underwear: it is important that you have it,
 but showing it to the wrong people has the tendency to make them
 feel uncomfortable." -- Angela Johnson
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to