SQLite Forum

C/C++ API: Is it posiible to clone database connection?
> Looks like a serialized thread mode with the one shared connection.

This is assuming fact not in evidence.  This whole scenario requires no more than one single thread and one connection.

 > Serialized mode!

All connections in SQLite3 are serial.  The choice is whether YOU do the serialization or whether SQLite3 forces it on you.  Nevertheless, executing something on a connection is *ALWAYS AND WITHOUT EXCEPTION* a one-thread-of-execution-at-a-time side-after-each.

 > But in the same time Studio can stop two different long time queries in different tabs separately.

This is the Hooey-Gooey thread calling the interrupt hook of the connection that it wants to interrupt in response to the event of a ugly-bag-of-mostly-water pushing a hooey-gooey button or something, and has nothing whatsoever to do with anything at all.

And the reason that two queries can run simultaneously is because they are using two threads, each of which is executing a query on different connections.

If "N" queries in the same process are executing sqlite3 queries at the same time, then they are doing so using "N" threads and "N" connections.  You cannot execute more than 1 thing per connection at a time -- ever.