Re: [sqlite] Is it safe to use same sqlite connection sequentially between threads ?

2017-08-16 Thread Dominique Devienne
On Wed, Aug 16, 2017 at 4:15 PM, Keith Medcalf wrote: > Setting "multithreaded" mode disables these checks in the SQLite3 library > and it is up to the application level code to ensure the single-entrance > per connection is enforced at the application level. If the

Re: [sqlite] Is it safe to use same sqlite connection sequentially between threads ?

2017-08-16 Thread Keith Medcalf
>According to your interpretation, "Single-thread" and "Multi-thread" >modes are equivalent: >> Multi-thread. In this mode, SQLite can be safely used by multiple >threads provided that no single database connection is used >simultaneously in two or more threads. >Assuming there *is* a

Re: [sqlite] Is it safe to use same sqlite connection sequentially between threads ?

2017-08-16 Thread Keith Medcalf
On Wednesday, 16 August, 2017 00:11, Gwendal Roué wrote: >> Le 15 août 2017 à 08:44, Clemens Ladisch a écrit : >> sanhua.zh wrote: >>> All 1. 2. 3. steps are run sequentially, which means that the step 2 >>> runs after step 1 finished and step 3

Re: [sqlite] Is it safe to use same sqlite connection sequentially between threads ?

2017-08-16 Thread Clemens Ladisch
Gwendal Roué wrote: >> Le 16 août 2017 à 08:38, Clemens Ladisch a écrit : >> Gwendal Roué wrote: >>> Serialized accesses from multiple threads is OK when the connection is >>> in the "Multi-thread" or "Serialized" threading modes, but not in the >>> "Single-thread" threading

Re: [sqlite] Is it safe to use same sqlite connection sequentially between threads ?

2017-08-16 Thread Gwendal Roué
> Le 16 août 2017 à 08:38, Clemens Ladisch a écrit : > > Gwendal Roué wrote: >> Serialized accesses from multiple threads is OK when the connection is >> in the "Multi-thread" or "Serialized" threading modes, but not in the >> "Single-thread" threading mode. > >

Re: [sqlite] Is it safe to use same sqlite connection sequentially between threads ?

2017-08-16 Thread Clemens Ladisch
Gwendal Roué wrote: > Serialized accesses from multiple threads is OK when the connection is > in the "Multi-thread" or "Serialized" threading modes, but not in the > "Single-thread" threading mode. says: | 1. *Single-thread*. In this mode, all mutexes are

Re: [sqlite] Is it safe to use same sqlite connection sequentially between threads ?

2017-08-16 Thread Gwendal Roué
> Le 15 août 2017 à 08:44, Clemens Ladisch a écrit : > > sanhua.zh wrote: >> All 1. 2. 3. steps are run sequentially, which means that the step 2 >> runs after step 1 finished and step 3 runs after step 2 finished >> theoretically . >> Also, I can make sure the memory order

Re: [sqlite] Is it safe to use same sqlite connection sequentially between threads ?

2017-08-15 Thread Clemens Ladisch
sanhua.zh wrote: > All 1. 2. 3. steps are run sequentially, which means that the step 2 > runs after step 1 finished and step 3 runs after step 2 finished > theoretically . > Also, I can make sure the memory order between threads. > > Then, is it a safe way to use sqlite connection ? Yes.

[sqlite] Is it safe to use same sqlite connection sequentially between threads ?

2017-08-14 Thread sanhua.zh
Here is a sample. As for a specific sqlite connection, 1. sql is executed in thread A 2. sql is prepared in thread B 3. Prepared statement in 2. is stepped and finalized in thread C All 1. 2. 3. steps are run sequentially, which means that the step 2 runs after step 1 finished and step 3 runs