Last Comment Bug 504914 - 'database is locked' errors
: 'database is locked' errors
Product: Webtools Graveyard
Classification: Graveyard
Component: Verbatim (show other bugs)
: Trunk
: All All
-- normal (vote)
: ---
Assigned To: Nobody; OK to take it and work on it
Depends on:
  Show dependency treegraph
Reported: 2009-07-17 13:06 PDT by Fred Wenzel [:wenzel]
Modified: 2016-02-12 08:06 PST (History)
5 users (show)
See Also:
QA Whiteboard:
Iteration: ---
Points: ---


Description User image Fred Wenzel [:wenzel] 2009-07-17 13:06:20 PDT
I am getting an increasing amount of 'database is locked' errors, particularly when I work with Verbatim on different tabs at the same time.

Not only are all write actions quite slow, I also run into the locking errors all the time, and I have a feeling the users will, as well.

We should probably investigate using MySQL again. Wil: Was there any reason in particular why you guys abandoned MySQL in favor of SQLite?
Comment 1 User image Wil Clouser [:clouserw] 2009-07-17 13:15:50 PDT
I don't remember anything specific.  I think any problems we had were was the abstraction, but I'm sure you'll find out soon. ;)

There might have been a couple sqlite-specific queries in pootle, maybe?  I don't remember.
Comment 2 User image Fred Wenzel [:wenzel] 2009-07-17 13:22:51 PDT
Thanks for the info, Wil. CCing Dwayne: Is there any reason why people wouldn't want to use MySQL as DB backend for Pootle? Is this a common setup? (It feels like it should be ;))

This problem is really becoming unacceptable: When I open five tabs (read-only, mind you), the first one will load after about 10 seconds, the remaining four will end up showing an OperationalError due to a locked DB.

Might this be related to bug 1051 over in Pootle's bug tracker (
Comment 3 User image Wil Clouser [:clouserw] 2009-07-17 13:27:04 PDT
There is no reason not to.  I think we (mozilla) added the mysql support just to prevent this.

We moved to sqlite relatively late and it was only a temporary thing.  I wanted to get pootle setup using the defaults (since this was all right after the merge) and then switch to mysql, and then migrate users/permissions.
Comment 4 User image Fred Wenzel [:wenzel] 2009-07-17 13:31:52 PDT
Ah, nice, that means somewhere on the "road to production" there's a nice little "use MySQL" bug. Which this one may just turn into. Sigh ;)
Comment 5 User image Wil Clouser [:clouserw] 2009-07-17 13:34:17 PDT
You mean bug 444621? ;)
Comment 6 User image Fred Wenzel [:wenzel] 2009-07-17 13:37:09 PDT
Funny. Looks like you closed this bug for the mere reason that Pootle *can* use MySQL, not because our instance *does* ;)
Comment 7 User image Dwayne Bailey 2009-07-19 22:51:35 PDT
@wenzel: Friedel probably know better.  But I think the logic has been. 1) Yes we want to support other DBs, 2) Abstraction would be needed for that, 3) Lets get the DB stable with all the changes before we deal with abstraction.

Might be best to talk on IRC with Friedel about what his ideas are and how to proceed.

I agree its a desired feature, especially on large installations.
Comment 8 User image Jeff Balogh (:jbalogh) 2009-07-20 08:22:33 PDT
Fun story: I switched bosley from sqlite to mysql because I was getting locking errors with sqlite in what I thought was completely valid code that shouldn't have any conflicting inserts.

All the locking errors are gone.  sqlite just can't handle heavy concurrency.
Comment 9 User image Fred Wenzel [:wenzel] 2009-07-20 11:13:07 PDT
(In reply to comment #8)
> All the locking errors are gone.  sqlite just can't handle heavy concurrency.

s/heavy/any/ ?
Comment 10 User image Dwayne Bailey 2009-07-21 00:13:33 PDT
A heads up.  The stats cache, which is generated by tools in the Translate Toolkit, is using sqlite and not going through Django.
Comment 11 User image Zibi Braniecki [:gandalf][:zibi] 2009-12-02 14:59:41 PST
since the update to Pootle 2.0.0-rc2 we cannot reproduce this. Reopen if needed.

Note You need to log in before you can comment on or make changes to this bug.