Skip to Main Content

Berkeley DB Family

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Validity of handles after error calling DB->open

558804Jan 29 2007 — edited Jan 29 2007
Hi,

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
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 26 2007
Added on Jan 29 2007
1 comment
826 views