|
Subject: Re: "database is locked" on first commit? Newsgroups: gmane.comp.python.db.pysqlite.user Date: 2007-10-20 04:38:40 GMT (1 year, 6 weeks, 3 days, 17 hours and 16 minutes ago) Expires: This article expires on 2007-11-03 On Fri, 19 Oct 2007 00:18:42 -0400, Mike <mike@...> declaimed the following in gmane.comp.python.db.pysqlite.user: > I'm having a "database is locked" problem with pysqlite. > > My python script creates several threads, and creates a database > connection in each one. The first query to run that requires a commit > fails and produces a "database is locked" error. I'm sure no other > queries/connections/programs/etc are modifying my database file, and Doesn't matter if they are modifying or not -- as long as you have an "uncommitted" /read query/ in one thread, you can't commit in another thread. Commit requires an exclusive lock on the file, so ALL OTHER connections/cursors/queries (ie, any other open transactions) MUST commit/rollback/close. Remember, the specifications for Python's db-api are that connections are NOT "auto-commit". -- Wulfraed Dennis Lee Bieber KD6MOG wlfraed@... wulfraed@... HTTP://wlfraed.home.netcom.com/ (Bestiaria Support Staff: web-asst@...) HTTP://www.bestiaria.com/ |
|
|