Hello everyone,

I’ve enabled WAL (Write-Ahead Logging) in my RC6 SQLite database using:

Code:
cn.ExecCmd "PRAGMA journal_mode=WAL"
It seems to work fine – the -wal and -shm files are created as expected.
I'm also using RC6's built-in encryption layer.

My Setup

I have multiple ActiveX/OLE worker objects, designed in the style of Olaf Schmidt’s MBSet architecture.
Each worker potentially runs in a separate process (EXE) and accesses the same encrypted SQLite database concurrently.

Examples:

Worker 1: Fetches and sends emails.
It reads from the DB, writes incoming messages, logs send results, and keeps the connection open indefinitely.
This runs every 10 minutes.

Worker 2: Handles forwarding of specific messages.

Worker 3: Parses emails and stores structured data.

All workers share the same database file, potentially accessed at the same time from different EXEs.

I enabled WAL mode specifically to avoid locking issues and improve write concurrency.

The Problem
After I had to forcefully terminate one of the workers, I couldn’t open the database as usual anymore.
Looks like it was left in an inconsistent state – probably due to incomplete WAL commits or locked *.shm state.

My Questions
Has anyone worked with encrypted SQLite + WAL mode in a multi-process environment using ActiveX/OLE components?

Are there any known caveats when keeping multiple connections open across EXEs?

Is it safe to leave connections open long-term, or should I periodically close and reopen them?

Could the combination of WAL and RC6 encryption introduce issues during abrupt termination?

I'm going to investigate this further, but I’d really appreciate any shared experience or best practices on this topic.

Thanks in advance!