On Sat, Jan 5, 2013 at 7:14 AM, Krzysztof <dib...@wp.pl> wrote:

> Hi,
>
> I'm reading documentation about multi threading. I just want to be sure:
> 1. I can safely create another thread (with new handle / connection) in my
> application and modify SAME database at the same time
>

Yes, as long as you don't take compile-time or run-time actions to make
SQLite single-threaded.  The default is to be multi-threaded.



> 2. I want use second connection in thread for importing while main thread
> working "normally". By import I mean not backup, but importing documents
> (CSV)
>

Yes.


> 3. Can user modify table while another thread importing to it (in
> transaction)? What are restrictions? What should I look out for?
>

Only one thread can be in a write transaction at a time.  If you have two
threads that need to write, they have to take turns.


> 4. Records inserted by second thread will be "visible" for first connection
> after second thread commit transaction?
>

Correct


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



-- 
D. Richard Hipp
d...@sqlite.org
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to