Re: [sqlite] multithreaded app with in-memory database and transactions

2020-02-14 Thread Wim Hoekman
On 13-Feb-20 23:38, Keith Medcalf wrote: Correct. "memory" databases can only be shared between connections in the same process, and then only by the sharedcache method. In effect, a "memory" database is nothing more than a cache, and sharing it between connections means sharing the cache.

Re: [sqlite] multithreaded app with in-memory database and transactions

2020-02-13 Thread Keith Medcalf
On Thursday, 13 February, 2020 17:58, Jim Dodgen wrote: >I have often wondered what the performance difference is between /dev/shm >and :memory: databases Theoretically a :memory: database is faster than a /dev/shm stored database. A :memory: database is purely in memory and has no extra

Re: [sqlite] multithreaded app with in-memory database and transactions

2020-02-13 Thread Jim Dodgen
I have often wondered what the performance difference is between /dev/shm and :memory: databases Jim "Jed" Dodgen j...@dodgen.us On Thu, Feb 13, 2020 at 4:48 PM Keith Medcalf wrote: > > On Thursday, 13 February, 2020 17:06, Jim Dodgen > wrote: > > >I have placed databases on/in /dev/shm and

Re: [sqlite] multithreaded app with in-memory database and transactions

2020-02-13 Thread Keith Medcalf
On Thursday, 13 February, 2020 17:06, Jim Dodgen wrote: >I have placed databases on/in /dev/shm and shared them across both >threads and processes. Yeah, /dev/shm is a pre-existing tmpfs filesystem, separate from the one mounted on /tmp. I keep forgetting about that one ... -- The fact

Re: [sqlite] multithreaded app with in-memory database and transactions

2020-02-13 Thread Jim Dodgen
ay to Heaven says > a lot about anticipated traffic volume. > > >-Original Message----- > >From: sqlite-users On > >Behalf Of Wim Hoekman > >Sent: Thursday, 13 February, 2020 11:44 > >To: sqlite-users@mailinglists.sqlite.org > >Subject: [sqlite] multith

Re: [sqlite] multithreaded app with in-memory database and transactions

2020-02-13 Thread Keith Medcalf
irway to Heaven says a lot about anticipated traffic volume. >-Original Message- >From: sqlite-users On >Behalf Of Wim Hoekman >Sent: Thursday, 13 February, 2020 11:44 >To: sqlite-users@mailinglists.sqlite.org >Subject: [sqlite] multithreaded app with in-memory databa

[sqlite] multithreaded app with in-memory database and transactions

2020-02-13 Thread Wim Hoekman
I have an app which is multithreaded. Sometimes during lengty inserts a different thread (which only reads the database) sees part of the updated data. This would be solved by using transactions. However, during the transaction the "reading" thread gets a 'database table is locked' error.