logo       
Google Custom Search
    AddThis Social Bookmark Button
-->

Re: ProgrammingError: library routine called out of sequence: msg#00020

Subject: Re: ProgrammingError: library routine called out of sequence
Irmen de Jong wrote:
Irmen de Jong wrote:
[...]
3) it is safe to use a single database connection objects in
   *different* threads, when doing:
    a- acquire thread lock
    b- create cursor
    c- do sql query
    d- close cursor
    e- release threadlock

Is that correct?
I'm not sure about 3) being safe to do. [...]

Looks like it's not safe:

Quoting http://www.hwaci.com/sw/sqlite/faq.html#q8

(8) Is SQLite threadsafe?

[...] "Threadsafe" in the previous paragraph means that two or more threads can run SQLite at the same time on different "sqlite" structures returned from separate calls to sqlite_open(). It is never safe to use the same sqlite structure pointer simultaneously in two or more threads.
[...]

Under UNIX, you should not carry an open SQLite database across a fork() system call into the child process. Problems will result if you do.

-- Gerhard


-------------------------------------------------------
This SF.Net email sponsored by Black Hat Briefings & Training.
Attend Black Hat Briefings & Training, Las Vegas July 24-29 - digital self defense, top technical experts, no vendor pitches, unmatched networking opportunities. Visit www.blackhat.com


<Prev in Thread] Current Thread [Next in Thread>