Validity of handles after error calling DB->open
558804Jan 29 2007 — edited Jan 29 2007Hi,
I've some code that works fine under libdb 4.1.25 but is failing under 4.3.29. Basically, the code does this:
db_error = db->open (db, some_flags);
if (db_error) {
/* maybe need more flags */
db_error = db->open (db, some_other_flags);
if (db_error) {
/* does the directory exist? */
mkdir (path);
db_error = db->open (db, some_other_flags);
}
}
The problem when using 4.3.29 is the third db->open call, even if it succeeds and it should be read/write and the database thinks that it is read only. I see in the manual that after db->open() fails I should call db->close() and create a new handle, but is that really required? I'm guessing there is stale state in the re-used db handle.
Thanks for any help,
Ross