DB_DIRECT_DB causes db creation failure
645601Aug 1 2008 — edited Aug 4 2008Using C interface to 4.7 on Ubuntu 8 64 bit SMP
If I start a process with an empty environment other than DB_CONFIG, and the DB_CONFIG contains:
set_flags DB_DIRECT_DB
Then when the process tries to open the database file, it rejects it, saying that the physical file name is not valid:
read: 0x7fda60b21878, 65536: Invalid argument
Database 'DBDEFAULT_65536_D.db' - open failed: Invalid argument
It seesm that the open, despite being told to create the file if it does not exist, does not create it.
If I remove the DIRECT_DB flag, then run the same program, then everything works correctly. I can then set that flag and rerun the program and it still works correctly. It seems that creeat operations do not work correctly with DB_DIRECT_DB, at least on this Linux kernel.
Any ideas?
env flags:
env_flags =
DB_CREATE | // Create the environment if it does not already exist.
DB_INIT_TXN | // Initialize transactions
DB_INIT_LOCK | // Initialize locking.
DB_INIT_LOG | // Initialize logging
DB_INIT_MPOOL | // Initialize the in-memory cache.
#ifndef _WIN32
DB_SYSTEM_MEM | // Shared memory on UNIX like systems
#endif
DB_REGISTER | // Causes multi-process recovery detection
DB_RECOVER | // Only runs recover if absolutely necessary
DB_THREAD // Handles need to be multithreaded
;
db flags:
dbFlags |= DB_CREATE | // Create the database if it does not exist yet
DB_THREAD | // Handles need to be multithreaded
DB_AUTO_COMMIT // Auto commit writes that are not tranaction bounded
;
Jim