Hi Dan,

 Thanks for your suggestion.

> If you have any choice in the matter, don't use threads. Run all 5
> queries from the same thread. You can either run them sequentially,

Running sequentially might trouble me as I have to update more sets of
information at a cause of single event.
 
> or sqlite3_prepare() all 5 and then round-robin calls to sqlite3_step().
I have look into this. However, could you please let me know the overhead in
managing multiple connections? Does it create any impact on my application's
performance? 

On 8/10/07 11:41 AM, "Dan Kennedy" <[EMAIL PROTECTED]> wrote:

> On Fri, 2007-08-10 at 11:25 +0530, Bharath Booshan L wrote:
>> Hello All,
>> 
>>  I am using SQLite in one my application and I require to retrieve around
>> 4-5 sets of information simultaneously. I have opted to run the queries in
>> separate threads which seems obvious choice here.
>> 
>>  However, I came to know from one of the documents in sqlite.org that single
>> connection cannot be used simultaneously across threads.
>> 
>>  So I would like to hear any suggestions regarding the best wary to open &
>> manage multiple connections i.e.
>> 
>> a) Is it efficient to create new connections in separate thread each time
>> when the query needs to be executed? ( Here I am worried about the time
>> taken to open connection )
>> 
>> b) Is it efficient to create the number of connections required, in a single
>> thread and use it in different threads? ( although a connection will not be
>> used simultaneously and this will eliminate the effort to create different
>> connections but we need to ensure that a connection is used simultaneously
>> in different threads)
>> 
>> Looking forward to your suggestions,

 



-----------------------------------------------
Robosoft Technologies - Come home to Technology

Disclaimer: This email may contain confidential material. If you were not an 
intended recipient, please notify the sender and delete all copies. Emails to 
and from our network may be logged and monitored. This email and its 
attachments are scanned for virus by our scanners and are believed to be safe. 
However, no warranty is given that this email is free of malicious content or 
virus.



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

Reply via email to