Closed GoogleCodeExporter closed 8 years ago
[deleted comment]
The FAQ is incorrect. Only SQLITE_THREADSAFE=2 is supported;
SQLITE_THREADSAFE=1 sets the default threading mode to Serialized.
SQLITE_THREADSAFE=2 sets the default threading mode to Multi-threaded.
Original comment by noah.hart@gmail.com
on 14 May 2012 at 9:02
Both SQLite official pages
(
http://www.sqlite.org/faq.html#q6
http://www.sqlite.org/threadsafe.html
)
state that SQLITE_THREADSAFE=1 is default for precompiled binaries.
Official FAQ does not define that it is Multi-thread or Serialized mode.
Official page about thread-safety says that 1 - Serialized mode.
So my original bug-report was wrong abount mode names.
So I agree with statement:
1 - Serialized
2 - Multi-threaded
http://code.google.com/p/csharp-sqlite/wiki/FrequentlyAskedQuestions
now states that only Multi-threaded mode (2) is supported.
sqlite3_threadsafe() in csharp-sqlite returns 2 by default (Multi-threaded).
That proves your FAQ is correct. And that differs default csharp-sqlite
behavior from default official SQLite version.
In this mode single Sqlite3.sqlite3 instance can not be used in different
threads at all. Sample application proves that.
I wonder what happens with csharp-sqlite when connection is opened with
SQLITE_OPEN_NOMUTEX flag, as it is done in the sample application.
So it seems this bug-report should be feature request instead:
Allow reusing of single Sqlite3.sqlite3 instance in different threads.
In sample application only one thread works with single Sqlite3.sqlite3
instance at the same time, but it hangs.
Most probably supporting SQLITE_THREADSAFE=1 (Serialized mode) by default will
solve the problem.
Original comment by iyu...@gmail.com
on 16 May 2012 at 1:29
Nice analysis, and agreed, feature request;
Closing Issue .. please reopen on ClientVoice if this mode is needed:
http://csharpsqlite.uservoice.com/forums/41270-general
Original comment by noah.hart@gmail.com
on 16 May 2012 at 1:48
I did some further research on this issue.
Native SQLite version compiled with SQLITE_THREADSAFE=2 allows reusing of
database instance in another thread. I assume its just not threadsafe.
So my problem was not caused by SQLITE_THREADSAFE mode, and I don't need
SQLITE_THREADSAFE=1 mode at the moment.
Instead of this I found some bugs in managed version that was causing my
problems. Opened bug report about that:
http://code.google.com/p/csharp-sqlite/issues/detail?id=159
Attached native SQLite version compiled with SQLITE_THREADSAFE=2 for x86
architecture.
Original comment by iyu...@gmail.com
on 17 May 2012 at 8:33
Attachments:
Original issue reported on code.google.com by
iyu...@gmail.com
on 14 May 2012 at 5:40Attachments: