Re: [sqlite] WAL mode for in-memory databases?

2019-01-14 Thread Stephen Chrzanowski
That doesn't sound healthy at all. If your application dies, what happens to the database? What if something rogue starts hitting it and just chews up your memory? IMO, Mem databases should be short lived and treated simply as an intentional cache. I get they're fast, but, long term life for a

Re: [sqlite] SQLite error (5): database is locked

2019-01-14 Thread Simon Slavin
On 14 Jan 2019, at 7:04pm, Tim Streater wrote: > Hmm, from my attempt at interpreting the source code I gained the impression > that the handler used exponential backoff for the first few attempts, but > then used a constant period for the rest (up to the set limit). Is this not > the case?

Re: [sqlite] SQLite error (5): database is locked

2019-01-14 Thread Tim Streater
On 14 Jan 2019, at 18:54, Simon Slavin wrote: > SQLite's own busy_timeout routine (the one you get if you don't supply your > own) uses exponential backoff. It first sleeps for a very small amount of > time, then checks the lock. If access is still prevented it sleeps longer, > then checks

Re: [sqlite] SQLite error (5): database is locked

2019-01-14 Thread Simon Slavin
On 14 Jan 2019, at 6:34pm, Thomas Kurz wrote: >> pragma_busy_timeout > > Does setting the busy_timeout retry periodically (e.g. every x milliseconds), > or is there some automatism that ensures that the requested operation is done > just-in-time as soon as the previous/blocking operation is

Re: [sqlite] WAL mode for in-memory databases?

2019-01-14 Thread Thomas Kurz
It would also be very helpful if more control about in-memory-databases was available. As far as I have understood, an in-memory database is deleted when the last connection closes. This requires me to always hold a connection to an in-memory database even if don't need it right now. Maybe one

Re: [sqlite] SQLite error (5): database is locked

2019-01-14 Thread Thomas Kurz
> pragma_busy_timeout Does setting the busy_timeout retry periodically (e.g. every x milliseconds), or is there some automatism that ensures that the requested operation is done just-in-time as soon as the previous/blocking operation is finished? ___

Re: [sqlite] SQLite error (5): database is locked

2019-01-14 Thread Keith Medcalf
Are you getting as OS ERROR 5 or the SQLITE Return Code 5 (SQLITE_BUSY). The former means that the OS is indicating that the USERID you are using to run the task cannot open the file or the directory or the temporary files or the journal files required because it has not been granted the

Re: [sqlite] [EXTERNAL] SQLite error (5): database is locked

2019-01-14 Thread Simon Slavin
On 14 Jan 2019, at 11:14am, Urs Wagner wrote: >ProviderConnectionString = @"data source=" + _dataBase + > ";PRAGMA foreign_keys = ON;PRAGMA locking_mode = EXCLUSIVE;PRAGMA > schema.synchronous = NORMAL; PRAGMA schema.journal_mode = DELETE; PRAGMA > busy_timeout = 10" I am

Re: [sqlite] [EXTERNAL] SQLite error (5): database is locked

2019-01-14 Thread Urs Wagner
Thank You for Your explanation. We do not using explicit transactions, SaveChanges takes rather a lot of time. -Original Message- From: sqlite-users On Behalf Of Barry Smith Sent: Monday, January 14, 2019 1:50 PM To: SQLite mailing list Subject: Re: [sqlite] [EXTERNAL] SQLite error

Re: [sqlite] WAL mode for in-memory databases?

2019-01-14 Thread Brian Macy
I’m very interested in the answer to this as I was planning on do the exact same thing.  Not sure my app would even be able to function without WAL mode. Brian Macy On Jan 14, 2019, 8:28 AM -0500, Dominique Devienne , wrote: > On Mon, Jan 14, 2019 at 2:23 PM Wout Mertens wrote: > > > AFAIK,

Re: [sqlite] WAL mode for in-memory databases?

2019-01-14 Thread Dominique Devienne
On Mon, Jan 14, 2019 at 2:23 PM Wout Mertens wrote: > AFAIK, your best bet is to put a file db on a ramdisk (tmpfs). That's not a very portable solution, and a work-around at best. I don't see anything technical that would prevent WAL to work for ":memory:". "Shared-memory" "in-process" is

Re: [sqlite] WAL mode for in-memory databases?

2019-01-14 Thread Wout Mertens
AFAIK, your best bet is to put a file db on a ramdisk (tmpfs). The ":memory:" DB is per connection only. Wout. On Mon, Jan 14, 2019 at 11:37 AM Dominique Devienne wrote: > According to [1] WAL mode does not apply to in-memory databases. > But that's an old post, and not quite authoritative

Re: [sqlite] [EXTERNAL] SQLite error (5): database is locked

2019-01-14 Thread Barry Smith
That's not how you set a busy timeout using a connection string. That's not how you set any (pragma) options with a connection string. Check the System.Data.SQLite documentation (or google) to find out connection string parameters, or play around with the SQLiteConnectionStringBuilder. The

Re: [sqlite] [EXTERNAL] SQLite error (5): database is locked

2019-01-14 Thread Hick Gunter
Please note the the semicolon at the end of an SQL Statement is required. "PRAGMA busy_timeout = 100" is not complete SQL. Also, the schema prefix needs to be replaced with the attach name of the database whose properties you wish to query/change. It may be omitted if "main" is desired.

Re: [sqlite] [EXTERNAL] SQLite error (5): database is locked

2019-01-14 Thread Urs Wagner
We are using entity framework The timeout pragma does not work. Is think the timeout is not set, see below var esb = new EntityConnectionStringBuilder { Metadata = "res://*/RadaxModel.csdl|res://*/RadaxModel.ssdl|res://*/RadaxModel.msl",

[sqlite] WAL mode for in-memory databases?

2019-01-14 Thread Dominique Devienne
According to [1] WAL mode does not apply to in-memory databases. But that's an old post, and not quite authoritative when not from the official SQLite docs. I'd like to benefit from the MVCC of WAL mode, but for an in-memory database, with different threads, each with its own connection,

Re: [sqlite] [EXTERNAL] SQLite error (5): database is locked

2019-01-14 Thread Hick Gunter
With journal mode, SQLite supports 1 writer OR n readers; with WAL mode, SQLite supports 1 writer AND N readers. In any case, connections need to indicate if or how long they are willing to wait for the db file to be unlocked. Default is NO. The easiest way is to specify a timeout on the

Re: [sqlite] SQLite error (5): database is locked

2019-01-14 Thread Simon Slavin
On 14 Jan 2019, at 9:23am, Urs Wagner wrote: > I use several tasks in C# to call Sqlite queries. > No I get the error SQLite error (5): database is locked. > Is it not possible to use more than one tasks with Sqlite? Please set a timeout for all connections to your database:

[sqlite] SQLite error (5): database is locked

2019-01-14 Thread Urs Wagner
Hallo I use several tasks in C# to call Sqlite queries. No I get the error SQLite error (5): database is locked. Is it not possible to use more than one tasks with Sqlite? Regards Urs ___ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org