On 8 May 2016 at 10:14, just_rookie <925345468 at qq.com> wrote:

> Obviously, I did not do incompatible things with a database at the same
> time.
>

You are attempting to drop a table in databases 300_500.db and 600_900.db.
Obviously another process must create that table, since your test code
isn't.

Dropping a table involves writing to the database. To write the database it
must be locked. If another process already has a write-lock your MPI tasks
won't be able to obtain one and will fail with "database is locked". If
another process is holding a read-lock, your MPI tasks will obtain a
write-lock but won't be able to COMMIT until the read-lock is relinquished.

If you're getting "database is locked" even with a busy timeout of 10
seconds, you have something other connection to the DB holding on to a
lock. It could be that your other code is not calling sqlite3_finalize on
every sqlite3_stmt, or you just have long running transactions.

-Rowan

Reply via email to