Mark Gilbert wrote:
>>  > - We don't currently prepare SQL statements in advance, would this
>>>  technique benefit from somehow preparing statements *before* that
>>>  thread gets the lock on the database ?  Can we have multiple threads
>>>  using the SAME database connection preparing SQL Queries at the same
>>>  time (so long as only one is RUNNING the query at once ?).
>> With the latest sqlite, I believe you can even have multiple threads 
>> access the same database connection. In this case, access will still 
>> be serialized.
>> However, you can also have each thread create it's own database 
>> connection, then access the database concurrently (well, with 
>> limitations - there can always only be one writer thread). In this
>> case you can actually execute several statements in parallel on
>> different threads (i.e. different database connections).
> 
> In fact much of our access is read-only, so being able to work 
> multiple concurrent connections sounds perfect.
> 
> Could you confirm that we can open and execute additional read only 
> connections to the database whilst we already have a Transaction open 
> for our write thread ?
> 
> - We BEGIN the transaction on the write thread, then leave that in 
> place and only COMIT the transactions once per  minute to coincide 
> with our flush.    Can we open and close extra read connections to 
> the database on other threads whilst the write transaction is still 
> active (but idle) ?
> 
> Thanks for your insight
> 
> Cheers
> 
> Mark
>
First a performance suggestion.  You may be able to partition your data 
and users into multiple databases.  That would add concurrency.

Sqlite transactions have an intermediate locking mode which maintains 
read access right up to the point of the journal being committed.  That 
can enhance your concurrency.

> _______________________________________________
> 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