On Thu, Apr 05, 2012 at 04:04:23PM +0200, Andreas Wiencke scratched on the wall:
> 
> Hello,
> 
> I have a question regarding the locking in Sqlite3: Does Sqlite3
> lock the entire database when there is a lock on only one table?

  The whole database.  http://sqlite.org/lockingv3.html

> In my code I want to read from one table and write the results to
> another table. But if I don't fetch all the results and close the
> reading connection, I cannot write to another table in the same
> database.

  Do it all from the same connection.  The locks are "owned" by a
  database connection, so opening a second connection won't work, even
  if they're within the same process.

  You should, however, be able to run both the query and the inserts
  from the same connection without issues, even if they're intermixed.

   -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