Is there a way to ensure that a Zeoslib sqlite database is opened read only?

The official tester's forum for ZeosLib 7.1. Ask for help, post proposals or solutions.
Post Reply
vfclists
Fresh Boarder
Fresh Boarder
Posts: 15
Joined: 30.10.2007, 00:07

Is there a way to ensure that a Zeoslib sqlite database is opened read only?

Post by vfclists »

What settings can I use to ensure that a Sqlite database opened in Zeoslib will not interfere with the ability of another process to read from it?

I think that is something that should be set in the TZConnection properties. Is there some option or something in the parameters that will ensure that another process needing to write to the same database will not be blocked?
marsupilami
Platinum Boarder
Platinum Boarder
Posts: 1918
Joined: 17.01.2011, 14:17

Re: Is there a way to ensure that a Zeoslib sqlite database is opened read only?

Post by marsupilami »

Hello vfclists,

as far as I know SQLite always attaches in a way where other processes are able to read the same database. The database file only gets locked, when data is written to the database. So basically there is nothing to do in Zeos.
If however you happen to have a database with a lot of writes, it seems that reading processes can time out. In that case you might want to check out the SQLite write ahead log [1].

If you describe more of your problem, maybe we can help you in a better way.

With best regards,

Jan

1: https://www.sqlite.org/pragma.html#pragma_journal_mode
Post Reply