dbTalk Databases Forums  

multiple databases: DB->open EINVAL error

comp.databases.berkeley-db comp.databases.berkeley-db


Discuss multiple databases: DB->open EINVAL error in the comp.databases.berkeley-db forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
intmail01@gmail.com
 
Posts: n/a

Default multiple databases: DB->open EINVAL error - 12-30-2005 , 02:40 AM






Hello,

I tried to create a single file containing many databases.
Creating environnement then handle works well but opening the
database gives me an EINVAL error.

The documentation say that I must set up many things:

-locking
-pool
-page size
-encryption and checksum
-byte order
etc...


Could you tell me how to setu up the environnement and what
customizations
are realy required to build multiple database in a single files.

Thank you

------------------
OS: Linux slackware


Reply With Quote
  #2  
Old   
Patrick Schaaf
 
Posts: n/a

Default Re: multiple databases: DB->open EINVAL error - 12-30-2005 , 03:02 AM






intmail01 (AT) gmail (DOT) com writes:

Quote:
I tried to create a single file containing many databases.
Creating environnement then handle works well but opening the
database gives me an EINVAL error.
Your code is probably giving some bad parameter to the open call.
Maybe we could guess what, if you would show us the relevant code.

Quote:
Could you tell me how to setu up the environnement and what
customizations
are realy required to build multiple database in a single files.
I open my environment with these flags:

DB_INIT_MPOOL | DB_INIT_LOG | DB_INIT_LOCK | DB_INIT_TXN | DB_CREATE

Then I create a transaction tx, create the database handles dbA and dbB,
with no special flags, and open the databases like this:

dberr = dbA->open(dbA, tx, "filename", "dbA", DB_BTREE, DB_CREATE, 0644);
dberr = dbB->open(dbB, tx, "filename", "dbB", DB_BTREE, DB_CREATE, 0644);

Never failed me.

best regards
Patrick


Reply With Quote
  #3  
Old   
intmail01@gmail.com
 
Posts: n/a

Default Re: multiple databases: DB->open EINVAL error - 12-30-2005 , 03:15 AM



to Patrick Schaaf

When I open an env. I just use DB_CREATE flags.
I did not use transaction. Could you tell me more about tx ?

What home path have you created when you open env ? for me I set it
"." (point)

Intmail01


Reply With Quote
  #4  
Old   
Patrick Schaaf
 
Posts: n/a

Default Re: multiple databases: DB->open EINVAL error - 12-30-2005 , 03:47 AM



intmail01 (AT) gmail (DOT) com writes:

Quote:
When I open an env. I just use DB_CREATE flags.
I don't know what happens with such usage.

Quote:
What home path have you created when you open env ? for me I set it
"." (point)
I set it to "db", but "." should be a directory just as valid.

Unfortunately, due to time constrains, your request for explaining about tx
cannot be met. May I suggest you study the relevant documentation that
comes with Berkeley DB? It is much much better than anybody could be
in a Usenet posting.

best regards
Patrick


Reply With Quote
  #5  
Old   
intmail01@gmail.com
 
Posts: n/a

Default Re: multiple databases: DB->open EINVAL error - 12-30-2005 , 03:54 AM



The things I want to know is it realy important to use transaction ?


Reply With Quote
  #6  
Old   
Patrick Schaaf
 
Posts: n/a

Default Re: multiple databases: DB->open EINVAL error - 12-30-2005 , 03:59 AM



intmail01 (AT) gmail (DOT) com writes:

Quote:
The things I want to know is it realy important to use transaction ?
Sometimes it is, and sometimes it isn't. There is no one answer.
It there were one answer, transactions would probably not be optional.

best regards
Patrick


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.