We are using multiple processes accessing the same on-disk db with almost 
exclusively virtual tables.

Once the tables have been declared (CREATE VIRTUAL TABLE...), all other 
connections need only to load the modules. The xConnect method gets called on 
first access.

-----Urspr?ngliche Nachricht-----
Von: Dominique Devienne [mailto:ddevienne at gmail.com]
Gesendet: Dienstag, 06. Oktober 2015 15:51
An: sqlite-users at mailinglists.sqlite.org
Betreff: [sqlite] Multiple connections to in-memory DB and virtual tables

We use (for years now) an in-memory DB with both tables and virtual tables in 
our app.

We recently started experimenting with multiple connections to the same 
in-memory DB, thanks to URI filenames and shared cache, to perform queries in 
parallel. This seems to work well with regular tables, and we get close to a 3x 
speedup using 4-5 threads on some use cases (running many queries).

But now we're trying to configure virtual tables and multiple connections to 
that unique in-memory DB, and we're having some trouble. We're not sure yet 
it's not related to our code, which so far assumed a single connection was in 
use accessing the vtables, but I'd like to get a reality check for that use 
case from experts.

On the first connection, we declare the virtual module and its virtual tables. 
This also adds the vtables to sqlite_master. But then on additional connections 
to that same in-memory DB, we also need to declare a vmodule and vtables, 
right? Yet it's already in sqlite_master, and it fails on the "create virtual 
table" statement.

Is this use case supported by SQLite?
Has any one tried this successfully?
Any chance this might work in the near future?

Thanks for any input on this. --DD

PS: assume read-only use cases for now, and no concurrent writes during these 
// queries.
_______________________________________________
sqlite-users mailing list
sqlite-users at mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


___________________________________________
 Gunter Hick
Software Engineer
Scientific Games International GmbH
FN 157284 a, HG Wien
Klitschgasse 2-4, A-1130 Vienna, Austria
Tel: +43 1 80100 0
E-Mail: hick at scigames.at

This communication (including any attachments) is intended for the use of the 
intended recipient(s) only and may contain information that is confidential, 
privileged or legally protected. Any unauthorized use or dissemination of this 
communication is strictly prohibited. If you have received this communication 
in error, please immediately notify the sender by return e-mail message and 
delete all copies of the original communication. Thank you for your cooperation.


Reply via email to