[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-developers] Threadsafe SQLite

From: N. Durner
Subject: [GNUnet-developers] Threadsafe SQLite
Date: Fri, 30 Sep 2005 21:06:08 +0200
User-agent: Mozilla Thunderbird 1.0.6 (Windows/20050716)


the GPL'ed application GNUnet opens a SQLite DB inside the main thread
and uses statements that were prepared there in a few other threads
(protected by mutexes).
If SQLite was built with "--enable-threadsafe" (as Debian's
"libsqlite3-0" package), sqlite3_step fails with "library routine called
out of sequence".

The FAQ says:
An *sqlite3* structure can only be used in the same thread that called
sqlite3_open <> to create it.
You cannot open a database in one thread then pass the handle off to
another thread for it to use.
But this is only true for Unix builds compiled with
"--enable-threadsafe" (os_unix.c:1050). Statements prepared in the way
described above work on Win32 (os_win.c:628) and if SQLite isn't threadsafe.

Is this behavior really intended?

Thanks a lot,

Nils Durner

reply via email to

[Prev in Thread] Current Thread [Next in Thread]