dbTalk Databases Forums  

a simple question about environment

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


Discuss a simple question about environment in the comp.databases.berkeley-db forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Joe
 
Posts: n/a

Default a simple question about environment - 10-19-2005 , 10:19 PM






Dear All,

I want to manage dabases in Environments of BDB.

My code is like this:

//-------------------------------------------------------------
DbEnv xmlEnv(0);
Db * ftdb;

xmlEnv.open(".//", DB_CREATE, 0);
ftdb = new Db(&xmlEnv, 0);
ftdb->open(NULL, "freqtable.db", NULL, DB_BTREE, DB_CREATE, 0);
//-------------------------------------------------------------

The compile is OK but there's an error when I run it.
The error is
Db:pen: Invalid arguments

Who can tell me what's wrong?

Thanks very much!
Joe


Reply With Quote
  #2  
Old   
Ron
 
Posts: n/a

Default Re: a simple question about environment - 10-20-2005 , 03:22 PM






Can you turn on verbose error messages?

The Berkeley DB library optionally outputs a verbose error
message whenever it is about to return a general-purpose error,
or throw a non-specific exception. Whenever it is not clear why
an application call into Berkeley DB is failing, the first step
is always to turn on verbose error messages, which will almost
always explain the problem. For more information on turning on
verbose error messages, please see the "Run-time error
information" section of the Berkeley DB Reference Guide,
included in your download package and also available at:

http://www.sleepycat.com/docs/ref/debug/runtime.html

I would suggest turning on verbose error messages, and seeing
what output you get.

Ron


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

Default Re: a simple question about environment - 10-28-2005 , 03:18 PM



You might need to specific DB_INIT_MPOOL in the DbEnv:pen(...) call.
Like this:

xmlEnv.open(".//", DB_CREATE | DB_INIT_MPOOL, 0);


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.