-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 13.09.2012 17:50, Joe Mistachkin wrote:
> Marcus Ilgner wrote:
>> 
>> I'm one of the authors of the SQLite-WinRT component for Windows
>> 8.
> 
> Cool, the one on CodePlex?
> 
Oh, sorry, I forgot to include the link [1]. The one at Codeplex is
more targeted towards C# development while we developed our component
to use it from the new JavaScript/HTML-based framework in Windows 8.

>> Regarding this release, can you tell me what configuration was
>> used to compile it?
> 
> The default compilation options from the MSVC makefile were used,
> along with the extra options necessary for WinRT (e.g.
> SQLITE_OS_WINRT, WINAPI_FAMILY, etc).
> 
Ok, great to know, I'll have a look at the Makefile then.

>> I'm asking because we wondered why the binary is about double the
>> size of the one we had previously.
> 
> From where?  With what compilation options?
> 
We took the official release and included it in the component. The
precompiler defines were
SQLITE_OS_WINRT;SQLITE_ENABLE_UNLOCK_NOTIFY;SQLITE_TEMP_STORE=2

>> Also, there's a strange phenomenon occurring which is probably
>> some kind of race condition in the way that multi-threading is
>> done: sqlite3_step() returns a generic error code 1 (for a valid
>> statement) but when I proceed to call sqlite3_errmsg16(), the
>> error message for error 6 (table locked) is returned.
> 
> That is not necessarily a race condition.  It could be the
> sqlite3_step is returning SQLITE_ERROR and the last error code
> stored for the database could be something else, like
> SQLITE_LOCKED.  Also, the SQLite DLLs for WinRT are compiled with
> SQLITE_THREADSAFE=1.
> 

Ok, I was under the impression that sqlite3_step would always return
the same error code as in the db. If I understand you correctly, it
could be expected behaviour that a locked table returns SQLITE_ERROR
instead of SQLITE_LOCKED?

>> Generally speaking, is a locked table something that should be
>> handled or do you think there may be another problem at play
>> here? I see that SQLite does a lot of work to support seamless
>> multi-threading and since the one application is the only process
>> working on the database, I suspect that the problem may lie
>> elsewhere.
> 
> How many processes and/or threads are attempting to access the
> database simultaneously?  There can be only one writer at a time.
> Also, unless WAL is used, a writer may block a reader.
> 

I had activated WAL in this scenario. There should have only been one
writer at that point, but I just had an idea how to debug this further.

> -- Joe Mistachkin
> 

Thank you for the quick reply, it has already been very helpful!

All the best
Marcus Ilgner

[1] https://github.com/doo/SQLite3-WinRT
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.17 (MingW32)
Comment: Using GnuPG with Mozilla - http://www.enigmail.net/

iQEcBAEBAgAGBQJQUjoHAAoJELuOTdgGQnyZVhQH/RzFd+FmDrIdk5zCtOHOHEy8
NANmh4Uf4RqfpS2GZlCI0PI7Hyn4pczaPGBGKO1o8z0GJ0PjmqXcJKuKgxzOitaN
KBF+Ig8MkeecuwjIuxDLPYd6h7Urm8Srx8VzNhMPCj1e24uGOItkXQDe5MCgWUYY
S3kH1zyWYNfPstHsO2qims4YCnczHs49Eq0S2aEKWwLeSS8aqnZ/eY1+s4Iem1Qn
vvJT1o/rjzaIobVP1R022ChGMnLYr8rEvMb+1VKcBM/OQMo+6m+fD+DHQzSieB7w
V3dUkx8hx4HJbXh3d59qdAE5NLLQLJN789q+eY33eUzWB0cRV+slLl77TK+6EqQ=
=1GAj
-----END PGP SIGNATURE-----
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to