Re: [sqlite] Multiple connections, page sizes and cache

2017-02-16 Thread Kim Gräsman
I've now built an inventory of all our connections and their lifetimes. They come in three primary classes: 1) Perpetual -- opened on app startup, closed on shutdown 2) Periodical, transient, serial -- only one at a time, happens quite rarely (online backup) 3) Stochastic, transient, concurrent

[sqlite] Multiple connections to in-memory db via .net

2016-03-10 Thread Jarred Ford
How can I create multiple connections to a shared SQLite in-memory database via .net? Thanks in advance.

[sqlite] Multiple connections to in-memory db via .net

2016-03-09 Thread Joe Mistachkin
Jarred Ford wrote: > > How can I create multiple connections to a shared SQLite in-memory > database via .net? Thanks in advance. > SQLiteConnection connection = new SQLiteConnection( "FullUri=file::memory:?cache=shared;"); -- Joe Mistachkin

[sqlite] Multiple connections to in-memory DB and virtual tables

2015-10-07 Thread Dominique Devienne
On Tue, Oct 6, 2015 at 5:13 PM, Hick Gunter wrote: > 1) Each connection needs to load the image(s) that contain(s) the virtual > module code (unless you have already linked it into a single image). > 2) Each connection needs to declare the virtual module(s) by calling >

[sqlite] Multiple connections to in-memory DB and virtual tables

2015-10-06 Thread Eduardo Morras
ailto:emorrasg at yahoo.es] > Gesendet: Dienstag, 06. Oktober 2015 19:08 > An: sqlite-users at mailinglists.sqlite.org > Betreff: Re: [sqlite] Multiple connections to in-memory DB and > virtual tables > > On Tue, 6 Oct 2015 15:39:08 +0100 > Simon Slavin wrote: > > > There a

[sqlite] Multiple connections to in-memory DB and virtual tables

2015-10-06 Thread Eduardo Morras
On Tue, 6 Oct 2015 15:39:08 +0100 Simon Slavin wrote: > There are also things Virtual Tables can't do. For instance you > cannot index a Virtual Table using SQL commands. Does "SELECT reindex_virtual_table() FROM virtual_table" count as SQL command only? --- --- Eduardo Morras

[sqlite] Multiple connections to in-memory DB and virtual tables

2015-10-06 Thread Hick Gunter
rdo Morras [mailto:emorrasg at yahoo.es] Gesendet: Dienstag, 06. Oktober 2015 19:08 An: sqlite-users at mailinglists.sqlite.org Betreff: Re: [sqlite] Multiple connections to in-memory DB and virtual tables On Tue, 6 Oct 2015 15:39:08 +0100 Simon Slavin wrote: > There are also things Virtual Ta

[sqlite] Multiple connections to in-memory DB and virtual tables

2015-10-06 Thread Dominique Devienne
On Tue, Oct 6, 2015 at 4:39 PM, Simon Slavin wrote: > On 6 Oct 2015, at 2:51pm, Dominique Devienne wrote: > > Is this use case supported by SQLite? > > Whether this works correctly depends on how your Virtual Module is > written. It should be possible to implement this correctly, but I can >

[sqlite] Multiple connections to in-memory DB and virtual tables

2015-10-06 Thread Dominique Devienne
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

[sqlite] Multiple connections to in-memory DB and virtual tables

2015-10-06 Thread Simon Slavin
On 6 Oct 2015, at 2:51pm, Dominique Devienne wrote: > 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,

[sqlite] Multiple connections to in-memory DB and virtual tables

2015-10-06 Thread Hick Gunter
Ad3) using IF NOT EXISTS prevents problems with failing re-creation of tables -Urspr?ngliche Nachricht- Von: Dominique Devienne [mailto:ddevienne at gmail.com] Gesendet: Dienstag, 06. Oktober 2015 16:53 An: General Discussion of SQLite Database Betreff: Re: [sqlite] Multiple connections to in

[sqlite] Multiple connections to in-memory DB and virtual tables

2015-10-06 Thread Hick Gunter
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

[sqlite] Multiple connections to in-memory DB and virtual tables

2015-10-06 Thread Scott Hess
Your thread made me ponder what might be up, so I wrote a test using fts3: http://pastebin.com/AKP2yHuM and AFAICT, it works alright. I haven't specifically verified each of the flags to sqlite3_open_v2(), I just spammed what looked relevant in there. Hmm, should have commented the #if's

[sqlite] Multiple connections and page cache(s) reusability

2015-05-13 Thread Milan Kříž
Thanks for the reply. Therefore my expectation that the approach 3 should be the best is correct, isn't it? I mean, using a dedicated connection for each table should cause better reusablility of cached pages? Or what approach would you propose to get the best performance? Does SQLite have any

[sqlite] Multiple connections and page cache(s) reusability

2015-05-13 Thread Clemens Ladisch
Milan K??? wrote: > My understanding was that each connection has its own page cache. This is correct. > [...] Does SQLite have yet some other global cache? No. That other global cache is part of the OS. It might be possible that opening a file two times changes the OS's caching algorithm.

[sqlite] Multiple connections and page cache(s) reusability

2015-05-12 Thread Milan Kříž
Hello, I have a question regarding caching mechanism in SQLite. Especially when using multiple connections. My understanding was that each connection has its own page cache (if I don't use SQLITE_OPEN_SHAREDCACHE). However I wrote some tests and results didn't met my expectations... So what I

[sqlite] Multiple connections in same process out of sync

2013-06-23 Thread Yuriy Stelmakh
Hi all, I'm having an issue when using multiple connections inside same process. Shared -mode is off in my case because b-tree locking slowed down performance when shared cache was on. The issue i'm having is that when one connection performs an insert, sometimes the other connection's page cache

Re: [sqlite] Multiple connections to in-memory database

2012-07-05 Thread Jay A. Kreibich
On Thu, Jul 05, 2012 at 09:03:54AM -0400, Pavel Ivanov scratched on the wall: > So this feature shouldn't work for you. From my first message: > > > But this possibility was > > introduced in SQLite 3.7.13. So your asp.net provider should be > > compiled with the latest version of SQLite,

Re: [sqlite] Multiple connections to in-memory database

2012-07-05 Thread T Ü
:03 PM Subject: Re: [sqlite] Multiple connections to in-memory database So this feature shouldn't work for you. From my first message: > But this possibility was > introduced in SQLite 3.7.13. So your asp.net provider should be > compiled with the latest version of SQLite, otherwise it won't wo

Re: [sqlite] Multiple connections to in-memory database

2012-07-05 Thread Pavel Ivanov
ocking_blue2...@yahoo.com> wrote: > It returns 3.6.23.1 > > > From: Pavel Ivanov <paiva...@gmail.com> > To: T Ü <shocking_blue2...@yahoo.com> > Cc: General Discussion of SQLite Database <sqlite-users@sqlite.org> > Sent: Thursday, J

Re: [sqlite] Multiple connections to in-memory database

2012-07-05 Thread T Ü
It returns 3.6.23.1 From: Pavel Ivanov <paiva...@gmail.com> To: T Ü <shocking_blue2...@yahoo.com> Cc: General Discussion of SQLite Database <sqlite-users@sqlite.org> Sent: Thursday, July 5, 2012 3:40 PM Subject: Re: [sqlite] Multiple connec

Re: [sqlite] Multiple connections to in-memory database

2012-07-05 Thread Pavel Ivanov
On Thu, Jul 5, 2012 at 8:37 AM, T Ü wrote: > By trying I found out that SQLiteConnection("Data > Source=:memory:;cache=shared"); worked. > In a single aspx.page at cs code, first I open an in-memory database > connection > SQLiteConnection conn = new

Re: [sqlite] Multiple connections to in-memory database

2012-07-05 Thread T Ü
___ From: Pavel Ivanov <paiva...@gmail.com> To: T Ü <shocking_blue2...@yahoo.com>; General Discussion of SQLite Database <sqlite-users@sqlite.org> Sent: Thursday, July 5, 2012 3:21 PM Subject: Re: [sqlite] Multiple connections to in-memory database On Thu, Jul 5, 2012 at 7:4

Re: [sqlite] Multiple connections to in-memory database

2012-07-05 Thread Pavel Ivanov
On Thu, Jul 5, 2012 at 7:46 AM, T Ü wrote: > I have an asp.net application. > I open a sqlite in-memory connection with SQLiteConnection conn = new > SQLiteConnection ( "Data Source=:memory:" ); command. > I read that by using cache=shared parameter, I can make that

[sqlite] Multiple connections to in-memory database

2012-07-05 Thread T Ü
I have an asp.net application. I open a sqlite in-memory connection with SQLiteConnection conn = new SQLiteConnection ( "Data Source=:memory:" ); command. I read that by using cache=shared parameter, I can make that in-memory database reachable from other connections. 1.What is the way of

Re: [sqlite] Multiple connections to :memory: database

2009-07-21 Thread Igor Tandetnik
Shaun Seckman (Firaxis) wrote: > Is it possible to have multiple connections to a purely in-memory > database No. Igor Tandetnik ___ sqlite-users mailing list sqlite-users@sqlite.org

[sqlite] Multiple connections to :memory: database

2009-07-21 Thread Shaun Seckman (Firaxis)
Is it possible to have multiple connections to a purely in-memory database and if so how can one go by doing that? Would it be safe if the connections were on separate threads? -Shaun ___ sqlite-users mailing list sqlite-users@sqlite.org

[sqlite] multiple connections by multiple threads

2009-05-20 Thread Igor Trindade Oliveira
Hello, I like to know if is recommended to do multiple connections from multiple threads in Sqlite or the best approach is create just one connection to multiple threads. Each thread has a hight concurrence level. I already try to open one connection per thread with that arguments:

Re: [sqlite] Multiple connections from different threads

2009-04-11 Thread P Kishor
On Sat, Apr 11, 2009 at 8:58 PM, Vinnie wrote: > > Sorry for asking such a basic question, and it seems I know the answer but I > would like a confirmation. > > If I am executing the same SQL statement from multiple database handles to > the same database file, I still need

[sqlite] Multiple connections from different threads

2009-04-11 Thread Vinnie
Sorry for asking such a basic question, and it seems I know the answer but I would like a confirmation. If I am executing the same SQL statement from multiple database handles to the same database file, I still need to prepare a distinct sqlite3_stmt for each connection, even though the SQL

Re: [sqlite] Multiple connections to an in-memory database

2008-04-04 Thread Fin Springs
On Apr 4, 2008, at 11:11 AM, Dennis Cote dennis.cote-at-. | sqlite| wrote: > Why do you need two transactions in parallel? In general only one > connection can have a transaction open on a database at any time. > Locking is used to serialize transactions. Even with two connections, > you

Re: [sqlite] Multiple connections to an in-memory database

2008-04-04 Thread Dennis Cote
Fin Springs wrote: > Is it possible to open multiple connections to an in-memory database? > I'm pretty sure the answer is no. > I have an application that gets a db handle with > sqlite3_open(":memory"). If another thread in the application were to > make that same call, would it get the

[sqlite] Multiple connections to an in-memory database

2008-04-04 Thread Fin Springs
Is it possible to open multiple connections to an in-memory database? I have an application that gets a db handle with sqlite3_open(":memory"). If another thread in the application were to make that same call, would it get the same handle, another handle to the same in-memory database, or a

Re: [sqlite] Multiple connections to an in-memory database

2008-04-04 Thread Igor Tandetnik
Fin Springs <[EMAIL PROTECTED]> wrote: > Is it possible to open multiple connections to an in-memory database? No. > I have an application that gets a db handle with > sqlite3_open(":memory"). If another thread in the application were to > make that same call, would it get the same handle,

[sqlite] Multiple connections to an in-memory database

2008-04-04 Thread Fin Springs
Is it possible to open multiple connections to an in-memory database? I have an application that gets a db handle with sqlite3_open(":memory"). If another thread in the application were to make that same call, would it get the same handle, another handle to the same in-memory database, or a

[sqlite] Multiple connections and triggers

2007-12-17 Thread Prakash Reddy Bande
Hi, I am in a situation where-in there are multiple connections to a single sqlite database. When one connection updates the database other connections would like to get the information about the change (asynchronously, for example when user wants he will use some refresh like command of the

Re: [sqlite] multiple connections

2007-09-10 Thread Joe Wilson
--- Christian Smith <[EMAIL PROTECTED]> uttered: > As we saw when 3.3.0 was release with a non-backword compatible change in > storing booleans... Not quite the same. That was an intentional design decision they made at the time. As for bugs and unintended incompatibilities, you're always

Re: [sqlite] multiple connections

2007-09-10 Thread Christian Smith
Joe Wilson uttered: --- "D. Richard Hipp" <[EMAIL PROTECTED]> wrote: In 3.5, cache can be shared between all threads, but shared cache is still disabled by default. You have to invoke sqlite3_enable_shared_cache() to turn it on. I put a comment in the documentation that we might turn shared

Re: [sqlite] multiple connections

2007-09-02 Thread Joe Wilson
--- "D. Richard Hipp" <[EMAIL PROTECTED]> wrote: > In 3.5, cache can be shared between > all threads, but shared cache is still disabled by default. You have to > invoke sqlite3_enable_shared_cache() to turn it on. I put a comment in > the documentation that we might turn shared cache on by

Re: [sqlite] multiple connections

2007-09-02 Thread John Stanton
Sharing cache is a great feature and thankyou for shedding the sweat necessary to implement it. I do have a suggestion for V3.5. How about changing the name to Sqnotsolite? D. Richard Hipp wrote: On Sep 2, 2007, at 11:40 AM, Joe Wilson wrote: In sqlite 3.5 they've changed the design to

Re: [sqlite] multiple connections

2007-09-02 Thread D. Richard Hipp
On Sep 2, 2007, at 11:40 AM, Joe Wilson wrote: In sqlite 3.5 they've changed the design to share a single file descriptor for all connections to the same database. Also, connections to the same database in 3.5+ will share the same database page cache resulting in less overall memory

Re: [sqlite] multiple connections

2007-09-02 Thread Joe Wilson
--- Aviad Harell <[EMAIL PROTECTED]> wrote: > Regarding only to select statements, is there a known limit of number of > concurrent connections to Sqlite DB? > > What about concurrent connections to the same table in the sqlite DB? In sqlite 3.4.2 and earlier, each connection - even to the same

[sqlite] multiple connections

2007-09-02 Thread Aviad Harell
Hi, Regarding only to select statements, is there a known limit of number of concurrent connections to Sqlite DB? What about concurrent connections to the same table in the sqlite DB? Regards, Aviad

RE: [sqlite] Multiple connections - stale cache?

2007-07-10 Thread Mark Brown
My final post on this issue...vxWorks has confirmed a bug in their fstat() implementation. I'm hoping for a quick resolution. Thanks for the help. Mark > > Just a follow-up for the group... > > Richard was able to determine that my platform is having > trouble with an > fstat() call to get

RE: [sqlite] Multiple connections - stale cache?

2007-06-28 Thread Mark Brown
Just a follow-up for the group... Richard was able to determine that my platform is having trouble with an fstat() call to get the size of files on my file system. Specifically, the call is returning a size of 0 when it should be 11K. I am investigating the vxWorks platform and have found that

RE: [sqlite] Multiple connections - stale cache?

2007-06-27 Thread Mark Brown
Hi- No, I am not confident that my file locking code is working. For vxWorks, I needed to alter the .lock functionality, as it wouldn't compile. Pretty much changes such as calling stat() instead of lstat(), etc. However, for this example, I do know that the two threads operate serially (ie,

Re: [sqlite] Multiple connections - stale cache?

2007-06-26 Thread drh
"Mark Brown" <[EMAIL PROTECTED]> wrote: > > > REPEAT TEST 1 > - > DB Counter 0:0:42:-89 > DB Counter 0:0:42:-89 > DB Counter 0:0:42:-89 > DB Counter 0:0:42:-89 > DB Counter 0:0:42:-96 <-- What did my code do to cause this? This

RE: [sqlite] Multiple connections - stale cache?

2007-06-26 Thread Mark Brown
I have some odd results to report on the db counter. I put some diagnostic code in our database wrapper class to write out the db counter whenever a statement is executed. It will print out for every statement executed whether the statement is a SELECT or UPDATE or BEGIN TRANSACTION. Richard

RE: [sqlite] Multiple connections - stale cache?

2007-06-26 Thread Mark Brown
Hi Richard and Joe- It probably is some application error in our code. What puzzles me is that calling sqlite3_enable_shared_cache(1) appears to fix (or at least change) the behavior. Not sure if that triggers any ideas as to what our problem might be. Your suggestion of looking at the

Re: [sqlite] Multiple connections - stale cache?

2007-06-26 Thread drh
"Mark Brown" <[EMAIL PROTECTED]> wrote: > Thanks for the quick reply. Unfortunately, we are developing code > on the vxWorks platform, so I don't think sample code would be of > use. We have seen the problem for some time now...at least from > 3.3.12. The logic in SQLite that handles cache

RE: [sqlite] Multiple connections - stale cache?

2007-06-26 Thread Joe Wilson
Can you list all the compile flags you used to compile the sqlite3 library (including all -DOMIT_* defines)? --- Mark Brown <[EMAIL PROTECTED]> wrote: > Thanks for the quick reply. Unfortunately, we are developing code on the > vxWorks platform, so I don't think sample code would be of use. We

RE: [sqlite] Multiple connections - stale cache?

2007-06-26 Thread Mark Brown
Thanks for the quick reply. Unfortunately, we are developing code on the vxWorks platform, so I don't think sample code would be of use. We have seen the problem for some time now...at least from 3.3.12. The submitter of the ticket appears to have the exact same scenario as us. Hopefully he

Re: [sqlite] Multiple connections - stale cache?

2007-06-26 Thread drh
"Mark Brown" <[EMAIL PROTECTED]> wrote: > Hi- > > We have a scenario where we have two different database connections to the > same database. Each database connection is running on a separate thread, > but in this situation, we are only using one connection at a time. We are > finding that

[sqlite] Multiple connections - stale cache?

2007-06-26 Thread Mark Brown
Hi- We have a scenario where we have two different database connections to the same database. Each database connection is running on a separate thread, but in this situation, we are only using one connection at a time. We are finding that sometimes one database connection will do a "select" on

Re: [sqlite] Multiple connections to the same database and CREATE TABLE command

2007-05-11 Thread Vivien Malerba
On 5/11/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: "Vivien Malerba" <[EMAIL PROTECTED]> wrote: > Hi! > > In a single process, I open two connections (C1 and C2) to the same > database (this is actually a corner case which could happen) and the > following sequence of operations fail: > 1-

Re: [sqlite] Multiple connections to the same database and CREATE TABLE command

2007-05-11 Thread drh
"Vivien Malerba" <[EMAIL PROTECTED]> wrote: > Hi! > > In a single process, I open two connections (C1 and C2) to the same > database (this is actually a corner case which could happen) and the > following sequence of operations fail: > 1- on C1 execute "CREATE table actor (...)" => Ok > 2- on C1

Re: [sqlite] Multiple connections to the same database and CREATE TABLE command

2007-05-11 Thread Mohd Radzi Ibrahim
Is C1 in transaction? If it is, commit will enable C2 'see' the new table. regards, Radzi. - Original Message - From: "Vivien Malerba" <[EMAIL PROTECTED]> To: <sqlite-users@sqlite.org> Sent: Friday, May 11, 2007 4:19 PM Subject: [sqlite] Multiple connection

Re: [sqlite] Multiple connections to the same database and CREATE TABLE command

2007-05-11 Thread Martin Jenkins
Vivien Malerba wrote: Hi! In a single process, I open two connections (C1 and C2) to the same database (this is actually a corner case which could happen) and the following sequence of operations fail: 1- on C1 execute "CREATE table actor (...)" => Ok 2- on C1 execute "SELECT * FROM actor" =>

[sqlite] Multiple connections to the same database and CREATE TABLE command

2007-05-11 Thread Vivien Malerba
Hi! In a single process, I open two connections (C1 and C2) to the same database (this is actually a corner case which could happen) and the following sequence of operations fail: 1- on C1 execute "CREATE table actor (...)" => Ok 2- on C1 execute "SELECT * FROM actor" => Ok 3- on C2 execute