It seems that this explanation as well as all other statements in the
thread you linked are coming from the wrong assumption that SQLite's
handles cannot be used from any thread other than the one created that
handle. Although this was true in some earlier versions of SQLite it's
not true in the current version. So if SQLite is compiled with
THREADSAFE=1 (as mentioned in that thread) then you can do with it
whatever you want. Just beware of possible data races and potentially
uncommitted transactions because of some open statement handles. And
if as you say there's no simultaneous access to the database from
different threads then there's no difference in your usage pattern
from single-threaded one.


Pavel

On Thu, Feb 3, 2011 at 7:29 AM, Stefano Mtangoo <mwinjili...@gmail.com> wrote:
>  From Urlich's explanation (I respect him as he is in the 'game of
> programming ' many years ahead me) is this, I quote:
> ----------------------------------
> This decreases the chance of failure but doesn't eliminate it, since
> still SQLite handles are passed around. As soon as the database thread
> accesses the database independently in parallel to the thread consuming
> the result set this could result in problems.
> -----------------------------------
>
> So what advice do you give me in such need that are thread safe? Any
> other approach?
>
>
> On 02/03/2011 03:09 PM, Pavel Ivanov wrote:
>> What problems did you meet when you tried to do what you want?
>>
>>
>> Pavel
>>
>> On Thu, Feb 3, 2011 at 4:39 AM, Stefano Mtangoo<mwinjili...@gmail.com>  
>> wrote:
>>> Hi,
>>> I use SQLite3 with wxSQLite3 wrapper and all is fine until I wanted to
>>> shift the DB thing into the secondary thread.
>>> What I want to do is send string containing query to secondary thread
>>> and the secondary thread is supposed to query db and post back the
>>> resultset.
>>> Urlich had doubts about the approach and full posts is here:
>>> http://forum.wxwidgets.org/viewtopic.php?t=29991
>>>
>>>
>>> How can I do that with SQLite3? No access to database at the same time.
>>> With thanks,
>>> Stefano
>>>
>>> --
>>> _________________________________________________________________________
>>> The purpose of man is to know his Maker Be known by his Maker And make his 
>>> Maker known So that others may know his Maker as their Maker(Emeal Zwayne)
>>>
>>> _______________________________________________
>>> sqlite-users mailing list
>>> sqlite-users@sqlite.org
>>> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>>>
>> _______________________________________________
>> sqlite-users mailing list
>> sqlite-users@sqlite.org
>> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>
>
> --
> _________________________________________________________________________
> The purpose of man is to know his Maker Be known by his Maker And make his 
> Maker known So that others may know his Maker as their Maker(Emeal Zwayne)
>
> _______________________________________________
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to