Luca Olivetti wrote:
> En/na Luca Olivetti ha escrit:
>> En/na Luca Olivetti ha escrit:
>>
>>> Hello,
>>> I'm using sqlite 3.3.8 under linux (mandriva 2007.1).
>> [...]
>>
>>> 1) is sqlite suitable when you have multiple threads accessing the same
>>> database? 

Yes.

With older versions you needed a separate connection for each thread. In 
newer versions several threads can share a single connection.


>>>Or should I delegate the access in a single thread and
>>> serialize the queries from the various threads?

That was often done with older versions. I'm sure many people still do 
it since they like the simplicity of using an external mutex to 
serialize access to the database file.

>>> 2) is sqlite suitable when you access the database from multiple programs?

Yes.


>>> 3) why did the first error (rowid missing, wrong # of entries) occur?

I have no idea.


>> Is it possible that the problem is due to the fact that apparently 3.3.8 
>> didn't --enable-threadsafe by default (and neither did the distro 
>> provided package)?

Yes, it's possible. See http://www.sqlite.org/faq.html#q6 and 
http://www.sqlite.org/cvstrac/wiki?p=MultiThreading for info about 
threading and SQLite.


> 
> It happened again (I have two machines where my program is running, one 
> I have updated to 3.5.6 with --enable-threadsafe, the other was still 
> running 3.3.8 without --enable-threadsafe, this one is the one that 
> failed, now I have upgraded it too), after a cascade of events the 
> database was cleaned with no tables, 

> but this time I saved a copy of the 
> damaged file.
> Could it be useful to analyze the situation, 

Possibly, but not likely.


> or should I just assume 
> that the problem was due to the missing "--enable-threadsafe"?

I wouldn't assume that. You should test it with a thread safe version to 
see if the problem is resolved.


> (I'm starting to wonder if my questions are too stupid anyway, in such a 
> case, please tell so).

Your questions aren't too stupid, just a little vague and without enough 
detailed context info for anyone to offer much real assistance.

HTH
Dennis Cote
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to