You don't need to open a second connection. The sole connection can be used from any thread.
You don't need to open a second connection. The sole connection can be used from any thread.
Why do you need two transactions in parallel? In general only one
connection can have a transaction open on a database at any time.
Even with two connections, you can't have two active transactions. The second will stall waiting
for the first to complete.
Hi in fact we've tested connection fo file based database with the SQLite driver. File consists of several tables. One thread was writting to tabe A and the second one was reading from table B. It was working quite OK and in paralel.
Two transactions were executed at the same moment.
Now we're looking to have the same behaviour with the memory based database.
As far as I know , the scenario of having different connections in each thread to the same physical file
is not applicable to in-memory database because you can not open several connections to the same in-memory
database.
We've thought that i.e. memory mapped file in shared memory segment could be a solution, but the problem is thet the file could be expanded during the write transactions.
And in Qt4 mechanism for mamory shared files is not existing anymore.
Hi everybdy.
We did it.
We've made our own driver to SQLite. In fact we've used sqlite3_open_v2 methd instead original sqlite3_open_v16 that is implemented in Qt default driver with flag set to NO MUTEXES. At run time we've not serialized acces to in memory database.
If fact the most mportat thing is to spawn only one connection per thread, but it's wrking in paralel.
Would like to have a look. Do your mind showing us some code...
Bookmarks