Sorry for the inconvenience *g* ... but now I have a new problem:
I have 8 database files which I open in a single environment. With the first 5 files everything is ok. But when my application tries to open the 6th file, there is an error:
file spiroTrials.db (meta pgno = 0) has LSN [1][17643].
end of log is [1][649]
BerkeleyDB/spiroTrials.db: unexpected file type or format
I understood that the LSN is the
log sequence number, but I have no idea why it should be 17643 for this file. The found
end of log 649 makes more sense to me.
Opening the database only works if the database file doesn't exist or the database contains no entries. When I put a entry into the database, exit the application and run it again, the error occurs --- but only with this one file. I tried to delete all database files several times, so that the log information should be deleted, too, but the error remains the same.
Additionally the error only occurs, if I use
Code:
environment->set_flags(DB_LOG_INMEMORY, 1);
But I don't want to write the logs to the disk because the application is being designed for an embedded device where disk space is limited.
I think it's up to the file size. The affected file is by far the largest file. I put more entries into the file and then the error message was
file spiroTrials.db (meta pgno = 0) has LSN [1][244442].
end of log is [1][649]
BerkeleyDB/spiroTrials.db: unexpected file type or format
So the [1][244442] is larger, the [1][649] is the same. And if I put even more data into the db files, the problem occurs with the other files, too. The only way to avoid the problem is to use logging in files.