Larry Lewis <lewislp-/[EMAIL PROTECTED]> wrote:
For a multi-threaded application using an in-memory database
 (":memory:"), would you recommend: a) an external mutex to
 synchronize exclusive access to the database -- probably the safest
 b) an external read-write lock to allow concurrent reads but only
one write (parallel of SQLite locking as I understand it) c) rely on
SQLite locking and handle SQLITE_BUSY cases as described below

c) is not an option, since you cannot have multiple connections to the same in-memory database. SQLite locking only works to arbitrate between multiple connections to the same database.

I'm not sure how safe it is to use the same SQLite connection from multiple threads. In the past, this has been explicitly prohibited. Restrictions have been relaxed in recent versions, but I must admit I've lost track of the state of the art in this area. Hopefully somebody more knowlegeable will chime in at this point and describe what exactly is and is not allowed nowadays.

Igor Tandetnik


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

Reply via email to