On 07/23/2013 01:38 AM, Philip Goetz wrote:
I have a Perl program that we have run successfully every day for
almost the past 2 years, but which crashes today with the error
message:

FATAL ERR: Can't do PRAGMA cache_size = 1000000: attempt to write a
readonly database

The SQLite database in question is readonly (group and world have only
read permission), and always has been, and the code has always used
PRAGMA cache_size = 1000000 on it immediately after opening its
readonly connection.

Running Perl 5.16.1 built for x86_64-linux-thread-multi on CentOS 6.
Have DBD::SQLite v. 1.39, Bundle::DBI 1.627.
The line of code that triggers the crash is

$dbh->do($cmd) or die "FATAL ERR: Can't do $cmd: $DBI::errstr";

where $cmd = "PRAGMA cache_size = 1000000"

Is there a way to set the default cache size for this sqlite db?
Is there a journal file in the file system?

If it is the first statement executed, "PRAGMA cache_size" will try
to read the schema from the database. If there is a hot-journal in
the file system, then it will need to be rolled back first. A
read-only connection can't do this.

Dan.





_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to