Richard,

Im getting some mixed signals here, on the one hand i am being told
that it should be ok to use a single transaction and connection across
multiple threads (assuming that it is correctly synchronised). But on
the other hand i am reading statements like that as part of a list of
things which may cause a sqlite misuse error.

"Trying to use the same SQLite database connection from two or more
threads at the same time."

Anyway, the sqlite_step() problem certainly explains one of the
crashes that i saw so that will save me some debugging.

Thanks to those who have suggested alternative designs and strategies.
I am currently adapting the single thread does all the database work
solution.

The documentation sources i have been looking at regarding threading
are (in addition to various discussions in this mailing list) here;

http://www.sqlite.org/cvstrac/wiki?p=MultiThreading
http://www.sqlite.org/lang_transaction.html
http://www.sqlite.org/lockingv3.html
http://www.sqlite.org/faq.html#q8

"With that and subsequent versions, it is safe to move a connection
handle across threads as long as the connection is not holding any
fcntl() locks. You can safely assume that no locks are being held if
no transaction is pending and all statements have been finalized."

The above statement regarding transactions was one of the things which
led me to believe that it was not possible to have the single
transaction, single connection and multiple thread arrangement.


Emerson

On 12/30/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
Joe Wilson <[EMAIL PROTECTED]> wrote:
> --- [EMAIL PROTECTED] wrote:
> > SQLite allows you to have multiple queries running at the
> > same time in multiple threads, as long as no two threads are
> > running sqlite3_step() at the same moment.
>
> Do you mean "as long as no two threads are running sqlite3_step()
> _for the same sqlite3* connection_ at the same moment"?
>

Yes.
--
D. Richard Hipp  <[EMAIL PROTECTED]>


-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------



-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------

Reply via email to