My current understanding, which may well be imperfect, is as follows:

 

1)     If you open an Sqlite database more than once (i.e. issue
multiple calls to sqlite3_open) for reading and writing then you will
get locking conflicts between the different connections

 

2)     So in order to avoid these problems, I have opened one connection
to the database but now I need to use it on multiple threads
concurrently

 

3)     If I do this then calls to sqlite3_prepare return with
SQLITE_MISUSE

 

4)     The Sqlite implementation of the iPhone says it is version 3.4 so
it should support multiple threading but I don't know if it is compiled
with the THREADSAFE preprocessor macro - does anyone know?

 

5)     The FAQ suggests this should be possible but other posts suggest
that you cannot share a connection between different threads

 

I need to have background threads that are updating the database whilst
the foreground thread is also accessing the database - is this possible
on the iPhone and if so, how?

 

(I realise that I could pipeline all database requests through a single
thread, probably the foreground one, but that will not fit with our
application architecture)

 

Thanks

 

Paul Clarke


*********************************************************************

Notice:  This email is confidential and may contain copyright material of Ocado 
Limited (the "Company"). Opinions and views expressed in this message may not 
necessarily reflect the opinions and views of the Company. 
If you are not the intended recipient, please notify us immediately and delete 
all copies of this message. Please note that it is your responsibility to scan 
this message for viruses.
Please do not print this email unless necessary.

*********************************************************************


Ocado Limited

Titan Court
3 Bishops Square
Hatfield Business Park
Hatfield
Herts
AL10 9NE
Tel: +44 (0) 1707 228000
Fax: +44 (0) 1707 227999
www.ocado.com
_______________________________________________
sqlite-users mailing list
[email protected]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to