Re: [sqlite] Preserve file descriptors for journal files

2019-08-12 Thread krimskrams
Hi,


On Sun, 7 Jul 2019 05:38:30 -0400

> Have you tried
>
> PRAGMA journal_mode=WAL;
>
> Does your application have exclusive access to the database file?  If
> so, then consider:
>
> PRAGMA locking_mode=EXCLUSIVE;

both options seem to work although the second one is not an option for
us. Thanks a lot!


Kind regards,

Frank
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Preserve file descriptors for journal files

2019-07-07 Thread Richard Hipp
On 7/4/19, krimskr...@vollbio.de  wrote:
> Hi,
>
> we currently switched from a simple file back-end to SQLite in our
> application (no threads, single process) and use the following
> settings:
>
> sqlite3_config(SQLITE_CONFIG_SINGLETHREAD)
> sqlite3_enable_shared_cache(0)
> PRAGMA synchronous = OFF
> PRAGMA journal_mode = TRUNCATE
>
> It is quite common that the systems we use run out of file
> descriptors. This is perfectly fine¹ and we could deal with this. With
> SQLite we have the issue that it constantly re-opens the journal file
> instead of keeping the file descriptor. Of course, when there are no
> file descriptors left it can't open the journal file and fails. Is
> there an option we missed? We're not sure how to fix this without
> implementing a VFS.

Have you tried

PRAGMA journal_mode=WAL;

Does your application have exclusive access to the database file?  If
so, then consider:

PRAGMA locking_mode=EXCLUSIVE;

-- 
D. Richard Hipp
d...@sqlite.org
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] Preserve file descriptors for journal files

2019-07-07 Thread krimskrams
Hi,

we currently switched from a simple file back-end to SQLite in our
application (no threads, single process) and use the following
settings: 

sqlite3_config(SQLITE_CONFIG_SINGLETHREAD)
sqlite3_enable_shared_cache(0)
PRAGMA synchronous = OFF
PRAGMA journal_mode = TRUNCATE

It is quite common that the systems we use run out of file
descriptors. This is perfectly fine¹ and we could deal with this. With
SQLite we have the issue that it constantly re-opens the journal file
instead of keeping the file descriptor. Of course, when there are no
file descriptors left it can't open the journal file and fails. Is
there an option we missed? We're not sure how to fix this without
implementing a VFS.


Kind regards,

Frank

¹ just take it for granted, needs not to be fixed
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users