All Questions
54 questions
0
votes
0
answers
21
views
Proper way to use transactions in SQL with WAL
I frequently get a Database Locked error when multiple workers access a database of tasks. As the tasks themselves are considerably longer than updating their status, I wrap each update call with a ...
0
votes
0
answers
94
views
What's the proper way to enable SQLite WAL mode with Kotlin's Exposed?
I tried this, using setupConnection, got it from a github issue:
import org.jetbrains.exposed.sql.Database
import org.sqlite.SQLiteConfig
Database.connect(
"jdbc:sqlite:$dbPath",
...
0
votes
0
answers
44
views
Sqlite-jdbc check if WAL mode is enabled
Is there a way to check if WAL mode is enabled for a database using sqlite-jdbc?
0
votes
1
answer
61
views
In WAL mode, does SQLite re-evaluate the WHERE-clause whenever another transaction commits first?
According to its documentation, Postgres re-evaluates all WHERE-clauses within a transaction whenever any other transaction is committed, in order to check if the updated row still matches the search ...
-4
votes
1
answer
326
views
How to activate sqlite WAL with PHP?
I write this:
$db = new PDO("sqlite:$dbname");
$db->exec("PRAGMA journal_mode = WAL;");
#.....
$wal_status = $db->exec("PRAGMA journal_mode;"...
1
vote
1
answer
300
views
How to show the WAL status in PHP?
My PHP code:
$db = new PDO("sqlite:$dbname");
$db->exec("PRAGMA journal_mode = WAL;");
How do I show the status of WAL e.g. "echo....."?
Thx in advance for your hints....
0
votes
1
answer
592
views
SQLite refuces to be set to WAL with Microsoft.Data.Sqlite .Net 7 in C#
I am unable to set WAL mode for SQLite programmatically.
My code is called when I create the database file
var conn = new SqliteConnection(_connectionString);
await using(conn....
0
votes
0
answers
273
views
Slow Insert into Sqlite in WAL as compared to Journal Mode Normal/OFF
My C application uses SQLite 3.36. I am trying to move journal mode from OFF to WAL.
But insertion in WAL takes 4 times longer. In the empty table, If insertion of N records taking 7 secs in Journal ...
0
votes
0
answers
269
views
Insert into Sqlite in WAL mode generating huge db-WAL file
My C application uses SQLite 3.36. I am using WAL mode for my DB. But on inserting ~50K records with 7 columns, the WAL file grows up to 1.5 GB.
I have disabled auto checkpointing and doing manual ...
0
votes
0
answers
123
views
Why accessing database via lua script deletes -wal file?
I have a question concerning SQLite & Lua. Basically i'm trying to use SQLite in WAL mode in my Android app. However if i perform a particular set of operations with database from my Lua script, ...
2
votes
1
answer
2k
views
Why the SQLite database file is locked using WAL Mode and Pooling enabled?
I am using a SQLite Database in my C# program.
The program saves values every second in the DB, and also checks everytime if the tables already exist:
class DataManager : IDataManager
{
private ...
2
votes
1
answer
2k
views
Why data is lost in SQLite database with WAL mode on when connection is not closed properly?
Problem: data is not available to SELECT from new connection to SQLite DB with WAL mode (Write Ahead Log) on if previous connection hasn't been closed properly. Main question is: why data is lost and ...
0
votes
0
answers
2k
views
How to recover a corrupt sqlite database with journal and WAL files
So I have a Kobo E-Reader and accidentally deleted the reading database.
The original file had an .sqlite extension and I managed to recover the database files.
When I finished recovering the files, ...
-1
votes
1
answer
795
views
How to enable WAL (write ahead log) in a C++ program?
I currently have two different processes, one process writes into a database and the other one reads and updates the records in the database that were inserted by the first process. Every time I try ...
2
votes
1
answer
977
views
What could be preventing SQLite WAL files from being cleared?
I've had three cases of WAL files growing to massive sizes of ~3 GB on two different machines with the same hardware and software setup. The database file itself is ~7 GB. Under normal runtime, WAL is ...
3
votes
1
answer
4k
views
SQLite WAL with the C# Entity Framework
For some reason my hosting only seems to work updating my SQLite database when it is set in WAL mode.
So using "DB Browser for SQLite" I edited the Pragma Journal Mode to WAL and everything seems to ...
0
votes
0
answers
660
views
PHP SQLite3 WAL - is close() required for each opened database connection even if it is the same?
Windows 10, PHP 7, SQLite3 database in wal mode, JQuery. JQuery ajax response is very slow, and entering and changing values in a field on web page results in the values showing/changing every 1 - 3 ...
0
votes
1
answer
249
views
Sqlite WAL mode : how much time should I expect to be locked in WAL mode?
I plan to use Sqlite with WAL mode (on a web server).
As I understand, the reads are never blocked with this mode, even when write occurs in the same time.
There is still only one write transaction ...
1
vote
0
answers
440
views
SQLite - Is it possible to increase database in chunks during wal mode?
I am recording data quite rapidly in a SQLite Database, which results in a lot of fragments on the disc (typically 2500 frags/file). When I later on try to search through this database it takes a long ...
-3
votes
1
answer
940
views
sqlite incremental data backup every 5 minute
I'm using sqlite database for storing my data, a application which keep writing to the database non-stop. (example windows perf data every 5 minutes)
What I need,
get all the data incremental every ...
10
votes
5
answers
7k
views
Disabling sqlite Write-Ahead logging in Android Pie
In Android Pie sqlite Write-Ahead logging (WAL) has been enabled by default. This is causing errors for my existing code only in Pie devices.
I have been unable to turn off WAL successfully using ...
0
votes
0
answers
1k
views
Making a checkpoint of SQLITE database in WAL mode after each insert/update/delete operation
I have SQLITE database inside my Xamarin Android app and I need to be able to read and write from it concurrently from different threads and/or processes. So I'm trying now to use it in WAL mode. It ...
1
vote
1
answer
3k
views
How to enable Write-Ahead Log(WAL) journal mode for SQLite in android?
I want to enable WAL mode for journal_mode. I'm using the class SqliteDatabase of CIPHER package. It does not have a enableWriteAheadLogging() method. And instead of that I tried to enable the mode ...
0
votes
1
answer
1k
views
Sqlite WALmode do not support memory mode?
I create my sqlite DB connection by using memory mode:
connection = DriverManager.getConnection("jdbc:sqlite:file:" + dbName + "?mode=memory&cache=shared")
And then use WAL-mode by excute: "...
2
votes
1
answer
2k
views
Does a SQLite WAL file ever reduce in size by itself?
My SQLite WAL file gets very large sometimes and I think that the file retains its size and just begins to overwrite as necessary, does it ever just reset its size?
I'm aware of the pragma ...
0
votes
1
answer
239
views
data-wal is being filled when syncing data to SQLite DB
I have connected my device and accessed my applications data by going to /data/data/my.package.name/databases.
Here I can see files:
data
data-shm
data-wal
As I can understand these files are ...
1
vote
1
answer
420
views
Can a Core Data .sqlite backup without a WAL file be restored to operate in WAL mode?
Please be patient with me - I'm going to try to use the correct terminology in this question. I have an iOS app that has allowed the users to create backups of their Core Data backed .sqlite database ...
3
votes
1
answer
2k
views
SQLite 3 WAL mode multiple processes frequently corrupting database
I am using SQLite 3 in WAL mode compiled with these flags:
#define SQLITE_ENABLE_FTS3 1
#define SQLITE_THREADSAFE 2
#define SQLITE_DEFAULT_MEMSTATUS 0
#define SQLITE_ENABLE_STAT4 1
#define ...
3
votes
1
answer
2k
views
WAL synchronization NORMAL vs. OFF
In the original documents for WAL the difference between FULL and NORMAL synchronization is clearly stated1:
Write transactions are very fast since they only involve writing the
content once (...
1
vote
1
answer
4k
views
SQLite: Write-Ahead Logging (WAL journal mode) with attached database
Working on database optimization, we split our database into two databases: db and db2. A low priority background thread is inserting into db2. Some of the queries on db are joined with db2, so we ...
2
votes
0
answers
343
views
Android sqlite write ahead logging notworking
I am using SQLiteOpenHelper in Android with calling setWriteAheadLoggingEnabled(true);
basically I do a bunch of network syncs (each one in their own thread and they call the next one in their ...
2
votes
1
answer
934
views
How Sqlite3 recovery in WAL mode when system crash
I'm wondering about the recovery progress in SQLite (WAL mode).
If system crash occurs, how SQLite knows 'I have to recovery using WAL file'?
and what SQLite exactly do in recovery progress?
please ...
0
votes
1
answer
526
views
What is the checksum algorithm in SQLite WAL
I'm wondering about the checksum algorithm in SQLite WAL mode
I already checked doc file but it says like this (this image is captured in sqlite doc file https://www.sqlite.org/fileformat2.html#...
1
vote
1
answer
917
views
Java SQLite in WAL mode: the database is locked
I'm using SQLite in my multithreaded application. To make sure that that won't cause problems, I've set the SQLite database to WAL mode. All threads share one connection that is never closed during ...
3
votes
5
answers
2k
views
Concurrency in SQLite database
How to achieve concurrency in SQLite database? As per documents it is possible using WAL(Write-Ahead Logging).But, I dont know how to implement it.
In my app I want to read data from db on main ...
1
vote
1
answer
476
views
SQLite3 multithread at same server
How can I perform a SQLite3 exec at the same time in PHP?
I have this code (by example):
$bd = new SQLite3("database.db");
$bd->busyTimeout(5000);
$bd->exec("INSERT into 'foo' ('data') values ('...
1
vote
1
answer
4k
views
sqlite3 WAL/SHM files not deleted
I have the following code
int main(){
sqlite3 *db;
int rc;
char filename[512];
char query[512];
char trace_string[512];
sqlite3_stmt *Stmt;
const char *zLeftover;
strcpy(filename,"/data/xcd/...
0
votes
1
answer
132
views
Failed to do checkpoint
int iReturn = sqlite3_wal_checkpoint_v2(m_poDB, NULL, SQLITE_CHECKPOINT_FULL, &iSizeOfWalLog, &iNumOfCheckpointedFrames);
returns with iReturn = 5 (SQLITE_BUSY). The writer wakes up now and ...
0
votes
1
answer
323
views
Can I use WAL mode in SQLite3 if I use an additional mutex for multiple writers?
http://sqlite.org/wal.html
WAL mode is specified for N readers and one writer. It the writer's identity interchangible? For example, I have N writers and an additional mutex. Each writer has to ...
0
votes
1
answer
1k
views
SQLite WAL-mode, in-memory, database with private cache?
I am working on a project which relies on the read snapshot isolation that the WAL journal mode provides in Sqlite. It uses multiple connections to the same database to allow concurrent readers and a ...
0
votes
1
answer
241
views
SQLite API to determine size of WAL file
Is there any api within SQLite which would return the current size of the WAL journal file? I need to check for its size periodically and perform some actions if it exceeds a certain limit. I am ...
10
votes
1
answer
8k
views
SQLITE database WAL file size keeps growing
I am writing continuously into a db file which has PRAGMA journal_mode=WAL, PRAGMA journal_size_limit=0. My C++ program has two threads, one reader(queries at 15 sec intervals) and one writer(inserts ...
1
vote
1
answer
808
views
Prevent data corruption
I'm working on an Embedded linux running on ARM9.
The filesystem is ext4 type (rw, sync, noatime, data=writeback)
I implemented a process that writes/reads to a SQLite3 database in a Write-Ahead-...
0
votes
0
answers
943
views
merge two sqlite databases with wal and shm constraints in iOS 7.0
I've read many threads about sqlite database and how to update with wal and checkpoint but I really do not understand despite all the information on Internet.
I merge two sqlite databases on a ...
3
votes
2
answers
849
views
How to save the content of a MOC to a file, with no -wal and no -shm?
I want to save the content of a MOC to a file myFile.ext. Everything works well, my data is saved to the file BUT I have to auxiliary files in addition:
myFile.ext-wal
myFile.ext-shm
Are these files ...
2
votes
1
answer
683
views
SQLite: Is there any way for use of WAL without mmap() function?
I want to use WAL mode for the reason of performance and reliability. However my environment doesn't have mmap() function, so I can't compile SQLite with WAL (WAL needs mmap().). Although setting ...
0
votes
0
answers
104
views
Background service and UI updates and implementing WAL
In my application, I run a service at 12 each night using an Alarm, everything works as intended.
I have three Fragment tabs, each tab has a listview, on click of a list item a detailed view is ...
30
votes
6
answers
23k
views
Is it safe to delete sqlite's WAL file?
I have a strange problem with Core Data in an iOS app where sometimes the WAL file becomes huge (~1GB). It appears there are other people with the problem (e.g. Core Data sqlite-wal file gets MASSIVE (...
5
votes
1
answer
1k
views
Creating SQLite database with Exclusive lock in C#
I'm trying to create a database with journal mode set to WAL and disable shared memory by setting locking mode to EXCLUSIVE but I can't seem to make it work.
My connection string looks like this:
...
1
vote
0
answers
275
views
SQLite WAL/SHM not deleted when another user runs a program
On a Linux system, I have a SQLite database created with Write-ahead logging, say, by user "bob".
/home/bob/sqliteTest/test.db
I also have a compiled program, called "sqliteTest" with sqlite ...