On 30 Nov 2010, at 3:49pm, cricketfan wrote:

>        I have 2 threads in my program, 1st thread is doing inserts into a 
> table and 2nd thread is trying to update the already inserted columns.
> 1. I have bundled the 1000 inserts per transaction in 1st thread.
> 2. When I try to start a transaction in the 2nd thread for my updates (when
> the 1st thread is running simultaneously) I am getting an error(error code 1
> - SQL error or missing database).
> If I start the begin transaction in 2nd thread after the 1st thread finishes
> it works normally. Is this normal behavior? Also not that both threads are
> using the same handle passed by main.

I think you identified the problem.  Try having separate handles for each 
thread.  Either have each thread open its own connection or have your main 
thread open two connections, one for the INSERTs, one for the UPDATEs.

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

Reply via email to