[odb-users] The right way to set the sqlite into WAL mode?
不明真相
52932688 at qq.com
Sun Jun 11 23:29:18 EDT 2023
Hi Boris,
I want to get the WAL mode support of SQLITE in ODB,
and I use the below code piece:
QScopedPointer<odb::database> db(new odb::sqlite::database(DB_FILE, SQLITE_OPEN_READWRITE));
// Position 1: db->execute("PRAGMA journal_mode=WAL");
odb::transaction t(db->begin());
//Position 2: db->execute("PRAGMA journal_mode=WAL");
.........
If I use the pragama at position 1, it will give me the error: operation can only be performed in transaction
If I use the pragma at position 2, I will get the error: cannot change into wal mode from within a transaction
I viewed the post [odb-users] Regarding Sqlite WAL model support in ODB (codesynthesis.com), So i guess the WAL mode could be enabled in libodb, but i cannot figure out where i am wrong.
And also if you have the idea on how to set the wal mode when creating the database file please tell me.
The version of libodb is 2.5.0_b.23, and used on windows 10 system.
Best Regards
More information about the odb-users
mailing list